about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-08-12 16:58:29 -0700
committerEric Wong <normalperson@yhbt.net>2009-08-12 16:58:29 -0700
commit99911621719a5798e24225ca40a1a11ef856faa5 (patch)
tree594faf136307ef220c328565dcec142e6e5f71da
parentb1adc4738b5fd9a42a5d686d67efae300d1c55ea (diff)
downloadunicorn-99911621719a5798e24225ca40a1a11ef856faa5.tar.gz
Otherwise we'll be creating an extra garbage string because
rb_hash_aset can't tell the string isn't being used elsewhere
and creates a new frozen one.
-rw-r--r--ext/unicorn_http/common_field_optimization.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/unicorn_http/common_field_optimization.h b/ext/unicorn_http/common_field_optimization.h
index dd090a6..a714368 100644
--- a/ext/unicorn_http/common_field_optimization.h
+++ b/ext/unicorn_http/common_field_optimization.h
@@ -104,7 +104,7 @@ static VALUE uncommon_field(const char *field, size_t flen)
   memcpy(RSTRING_PTR(f), HTTP_PREFIX, HTTP_PREFIX_LEN);
   memcpy(RSTRING_PTR(f) + HTTP_PREFIX_LEN, field, flen);
   assert(*(RSTRING_PTR(f) + RSTRING_LEN(f)) == '\0'); /* paranoia */
-  return f;
+  return rb_obj_freeze(f);
 }
 
 #endif /* common_field_optimization_h */