Date | Commit message (Collapse) |
|
String#-@ deduplicates strings starting with Ruby 2.5.0
Hash#[]= deduplicates strings starting in Ruby 2.6.0-rc1
This allows us to save a small amount of memory by sharing
objects with other parts of the stack (e.g. Rack).
|
|
While it is innocuous after compiling, it can be a confusing
source of errors for users with broken installations of Ruby
itself:
https://bogomips.org/unicorn-public/5ace6a20-e094-293d-93df-b557480e12d5@anyces.com/
https://bogomips.org/unicorn-public/02994a55-9c07-a3c5-f06b-a4c15551a67e@anyces.com/
rb_str_set_len has been provided since Ruby 1.8.7+, so we have
not needed it since we dropped all 1.8.x support in unicorn 5.x.
|
|
Calling the function directly avoids the overhead of Ruby method
table lookup and global method cache. The only downside is this is
now hidden from tracers and cannot be overridden from Ruby, but I
doubt anybody cares about that.
|
|
Rainbows! wants to be able to lower this eventually...
|
|
This can return a static string and be significantly
faster as it reduces object allocations and Ruby method
calls for the fastest websites that serve thousands of
requests a second.
It assumes the Ruby runtime is single-threaded, but that
is the case of Ruby 1.8 and 1.9 and also what Unicorn
is all about. This change is safe for Rainbows! under 1.8
and 1.9.
|
|
We do not link against any external libraries
|
|
Rubinius now supports rb_str_set_len() and sets -fPIC.
We shouldn't check for rb_str_modify() since link-time detection
is broken under Rubinius and even 1.8.6 has rb_str_modify().
|
|
Not everybody can use it, even if most of the world can.
|
|
Rubinius doesn't seem to set this by default
|
|
Rubinius has no rb_str_modify() function, it /may/
not need it.
|
|
Hope they have the LL2NUM macro (Rubinius does)
|
|
This ensures any string literals that pop up in *our* code will
just be a bag of bytes. This shouldn't affect/fix/break
existing apps in most cases, but most constants will always have
the "correct" encoding (none!) to be consistent with HTTP/socket
expectations. Since this comment affects things only on a
per-source basis, it won't affect existing apps with the
exception of strings we pass to the Rack application.
This will eventually allow us to get rid of that Unicorn::Z
constant, too.
|
|
Only fallback to check_sizeof() if it is not. check_sizeof() is
broken in Ruby 1.9.2preview1 (but fixed in trunk).
|
|
We'll be needing the UH_OFF_T_MAX define for the chunked
body handling and rb_str_set_len may be needed as well.
|
|
We couldn't do proper namespacing for the C module so there was
a potential conflict with Init_http11() in Mongrel. This was
needed because Mongrel's HTTP parser could be used in some
applications and we may be unfortunate enough need to support
them.
|