-
Notifications
You must be signed in to change notification settings - Fork 29.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
src: fix StringBytes::Write() #1042
Commits on Mar 5, 2015
-
PR-URL: nodejs#1042 Reviewed-By: Trevor Norris <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for f5b7e18 - Browse repository at this point
Copy the full SHA f5b7e18View commit details -
src: fix gc heuristic for external twobyte strings
Large external two-byte strings reported their character length instead of their byte length, throwing off the garbage collector heuristic by a factor of two. PR-URL: nodejs#1042 Reviewed-By: Trevor Norris <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 826cde8 - Browse repository at this point
Copy the full SHA 826cde8View commit details -
src: remove NODE_INVALID_UTF8 environment variable
Introduced in joyent/node v0.10 as a backwards compatibility measure. It's an ugly hack and allowing invalid UTF-8 is not a good idea in the first place, remove it. PR-URL: nodejs#1042 Reviewed-By: Trevor Norris <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 364cc7e - Browse repository at this point
Copy the full SHA 364cc7eView commit details -
src: simplify node::Utf8Value()
* Remove kStorageSize constant. * Remove superfluous local variable and reinterpret_cast. * Reorder data members so the length field and data pointer (if not the data itself) fit in a single cache line. PR-URL: nodejs#1042 Reviewed-By: Trevor Norris <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for c9ee654 - Browse repository at this point
Copy the full SHA c9ee654View commit details -
src: rename confusingly named local variable
Rename `val_` to `string`. The underscore suffix is normally reserved for data members, not locals, and it's not a great name in the first place. PR-URL: nodejs#1042 Reviewed-By: Trevor Norris <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 4aea16f - Browse repository at this point
Copy the full SHA 4aea16fView commit details -
test: simplify parallel/test-stringbytes-external
Make the algorithm that creates the big input strings a little easier to comprehend. No functional changes, the string lengths are unchanged. PR-URL: nodejs#1042 Reviewed-By: Trevor Norris <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for e2fb733 - Browse repository at this point
Copy the full SHA e2fb733View commit details -
src: fix external string length calculation
Make StringBytes::GetExternalParts() return the byte length for two-byte strings, not the character length. Its callers operate on bytes, not characters. This also fixes StringBytes::Size() reporting only half of the actual number of bytes for external two-byte strings. PR-URL: nodejs#1042 Reviewed-By: Trevor Norris <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 2eda2d6 - Browse repository at this point
Copy the full SHA 2eda2d6View commit details -
src: fix ucs-2 buffer encoding regression
StringBytes::Write() did a plain memcpy() when is_extern is true but that's wrong when the source is a two-byte string and the destination a one-byte or UTF-8 string. The impact is limited to strings > 1,031,913 bytes because those are normally the only strings that are externalized, although the use of the 'externalize strings' extension (--expose_externalize_string) can also trigger it. This commit also cleans up the bytes versus characters confusion in StringBytes::Write() because that was closely intertwined with the UCS-2 encoding regression. One wasn't fixable without the other. Fixes: nodejs#1024 Fixes: nodejs/node-v0.x-archive#8683 PR-URL: nodejs#1042 Reviewed-By: Trevor Norris <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 1640ded - Browse repository at this point
Copy the full SHA 1640dedView commit details