http: reduce parser from 72 to 56 bytes on 64-bit
commit4b2782a926d8f131b1e7382be35e3abb77bf4be5
authorEric Wong <e@80x24.org>
Sun, 7 Sep 2014 02:40:44 +0000 (7 02:40 +0000)
committerEric Wong <e@80x24.org>
Wed, 17 Sep 2014 03:15:25 +0000 (17 03:15 +0000)
tree31e3a624681fe164cb563658039d81025ffb2de2
parentb068871e4ca352048faf8db13d600ccdc429718d
http: reduce parser from 72 to 56 bytes on 64-bit

This allows the parser struct to fit in one cache line on
x86-64 systems where cache lines are 64 bytes.

Using 32-bit integer lengths is safe here because these are only for
tracking offsets within the HTTP header buffer.  We can safely limit
HTTP headers and in-memory buffers to be less than 4GB without
anybody complaining.

HTTP bodies continue to use off_t (usually 64-bit, even on 32-bit
systems) sizes and support as much as the OS/hardware can handle.
ext/unicorn_http/unicorn_http.rl
test/unit/test_http_parser_ng.rb