mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* ext/json: merge JSON 1.8.1.
002ac2771c...e09ffc0d7d
* Remove Rubinius exception since transcoding should be working now.
* Fix https://github.com/flori/json/issues/162 reported by Marc-Andre
Lafortune <github_rocks@marc-andre.ca>. Thanks!
* Applied patches by Yui NARUSE <naruse@airemix.jp> to suppress
warning with -Wchar-subscripts and better validate UTF-8 strings.
* Applied patch by ginriki@github to remove unnecessary if.
* Add load/dump interface to JSON::GenericObject to make
serialize :some_attribute, JSON::GenericObject
work in Rails active models for convenient
SomeModel#some_attribute.foo.bar access to serialised JSON data.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43731 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
9d740ddebe
commit
14cab32596
11 changed files with 112 additions and 41 deletions
|
@ -67,7 +67,7 @@ static VALUE fbuffer_to_s(FBuffer *fb);
|
|||
static FBuffer *fbuffer_alloc(unsigned long initial_length)
|
||||
{
|
||||
FBuffer *fb;
|
||||
if (initial_length == 0) initial_length = FBUFFER_INITIAL_LENGTH_DEFAULT;
|
||||
if (initial_length <= 0) initial_length = FBUFFER_INITIAL_LENGTH_DEFAULT;
|
||||
fb = ALLOC(FBuffer);
|
||||
memset((void *) fb, 0, sizeof(FBuffer));
|
||||
fb->initial_length = initial_length;
|
||||
|
@ -117,9 +117,9 @@ static void fbuffer_append_str(FBuffer *fb, VALUE str)
|
|||
const char *newstr = StringValuePtr(str);
|
||||
unsigned long len = RSTRING_LEN(str);
|
||||
|
||||
fbuffer_append(fb, newstr, len);
|
||||
|
||||
RB_GC_GUARD(str);
|
||||
|
||||
fbuffer_append(fb, newstr, len);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue