unicorn_http: small cleanups and size reduction
commitfb7f6739c5bc041a28ae45fea80f840459523f8e
authorEric Wong <normalperson@yhbt.net>
Sat, 1 Aug 2009 06:46:21 +0000 (31 23:46 -0700)
committerEric Wong <normalperson@yhbt.net>
Sun, 9 Aug 2009 08:18:49 +0000 (9 01:18 -0700)
treef4afd31a6d96a36d8865ccf180aaf51fb54229b8
parente710d55dd171ab560d9cc1b1684f0e415b153c76
unicorn_http: small cleanups and size reduction

Use Data_Make_Struct instead of Data_Wrap_Struct to avoid extra
steps/code in object allocation.  The GC will also free()
implicitly if no free callback is passed to Data_Make_Struct,
and we don't need an extra method here...

Since we're more comfortable with object management nowadays,
just make the data_get() fail with an assertion failure if it
somehow (very unlikely) ends up getting a NULL parser object.
Unicorn itself has no way of recovering other than throwing
errors to clients anyways and we have bigger problems if there's
a GC bug causing this.

Then, finally, reduce the size of our http_parser struct even
more (we'll add an int back later) since we know it's safe to
do so...
ext/unicorn_http/ext_help.h
ext/unicorn_http/unicorn_http.c
ext/unicorn_http/unicorn_http.h
ext/unicorn_http/unicorn_http.rl