summaryrefslogtreecommitdiff
path: root/ext/json/ext/parser/parser.rl
Commit message (Collapse)AuthorAgeFilesLines
* Some more changes from ruby 2.7.0merge-recent-ruby-changesFlorian Frank2019-12-101-3/+10
|
* Merge branch 'master' of github.com:flori/jsonFlorian Frank2019-04-291-2/+22
|\
| * Add some missing ruby 2.6 changesFlorian Frank2019-02-211-8/+10
| |
| * Fix for bigdecimal updatesKenta Murata2019-02-211-2/+19
| | | | | | | | `BigDecimal.new` is no longer available from bigdecimal-1.4.0.
| * ext/json/parser/parser.c: do not call rb_str_resize() on Time objectpick-ruby-coreeregon2018-10-251-1/+3
| | | | | | | | | | | | * See https://github.com/flori/json/issues/342 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64177 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| * Fix missed update of parser source in r62429eregon2018-10-251-0/+1
| | | | | | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64175 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* | Only attempt to resize strings not other objectsFlorian Frank2019-04-291-1/+1
|/
* Test the new feature and fix problemsFlorian Frank2017-04-181-2/+2
| | | | | | - Initialize i_new - Add to changes - Test on ruby 2.4.1
* Raise exceptionFlorian Frank2017-04-181-2/+10
| | | | for incomplete unicode surrogates/character escape sequences
* Support some older internal Ruby API (<2.0)Florian Frank2017-01-121-1/+1
|
* Merge decimal_class patch by Michael JaschobFlorian Frank2016-09-231-3/+20
| | | | | | Also: - Avoid some issues with bundler - Avoid some issues with jruby
* Fix issue #296 when parsing frozen stringsFlorian Frank2016-07-261-0/+3
|
* Stores current nesting on stackFlorian Frank2016-07-011-17/+12
|
* Exception encodingNobuyoshi Nakada2016-06-211-1/+1
| | | | Raise with messages in UTF-8 encoding.
* Remove unnecessary conversionNobuyoshi Nakada2016-06-211-1/+0
| | | | StringValue does the conversion.
* resize strings after parsingAaron Patterson2016-06-211-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The parser uses `rb_str_buf_new` to allocate new strings. `rb_str_buf_new` [has a minimum size of 128 and is not an embedded string](https://github.com/ruby/ruby/blob/9949407fd90c1c5bfe332141c75db995a9b867aa/string.c#L1119-L1135). This causes applications that parse JS to allocate extra memory when parsing short strings. For a real-world example, we can use the mime-types gem. The mime-types gem stores all mime types inside a JSON file and parses them when you require the gem. Here is a sample program: ```ruby require 'objspace' require 'mime-types' GC.start GC.start p ObjectSpace.memsize_of_all String ``` The example program loads the mime-types gem and outputs the total space used by all strings. Here are the results of the program before and after this patch: ** Before ** ``` [aaron@TC json (memuse)]$ ruby test.rb 5497494 [aaron@TC json (memuse)]$ ``` ** After ** ``` [aaron@TC json (memuse)]$ ruby -I lib:ext test.rb 3335862 [aaron@TC json (memuse)]$ ``` This change results in a ~40% reduction of memory use for strings in the mime-types gem. Thanks @matthewd for finding the problem, and @nobu for the patch!
* Merge more changes from ruby coreFlorian Frank2016-06-211-22/+37
|
* Force ASCII 8bit to be UTF-8 and hope for the bestFlorian Frank2016-06-031-6/+10
|
* Disallow usage of symbolize_names and create_additionsFlorian Frank2015-06-151-2/+8
|
* Ext parser is green now as wellFlorian Frank2015-06-151-101/+17
|
* Remove byte sniffing from Ext::ParserFlorian Frank2015-06-131-39/+4
|
* parser.rl: allocate structs with wrappernobu2015-05-281-10/+4
| | | | | | | | * ext/json/ext/parser/parser.rl (cJSON_parser_s_allocate): allocate structs with making new wrapper objects and get rid of potential memory leak. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50660 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* use ZALLOC if it can be used, and defined ZALLOC macro.SHIBATA Hiroshi2015-02-121-2/+1
|
* sync trunk again: fixed regression of r49027SHIBATA Hiroshi2015-02-121-5/+5
|
* Fall back to Data_* wrappers on ancient rubiesFlorian Frank2015-01-021-1/+3
|
* Merge branch 'ruby-2.2' of https://github.com/zzak/json into zzak-ruby-2.2Florian Frank2015-01-021-4/+21
|\ | | | | | | | | | | | | Conflicts: .travis.yml json.gemspec json_pure.gemspec
| * RUBY_TYPED_FREE_IMMEDIATELY isn't always availableZachary Scott2014-12-271-0/+2
| |
| * Sync with trunkZachary Scott2014-12-251-5/+20
| |
| * - Pass over generator.c for grammar fixes.Vipul A M2014-07-031-1/+1
| | | | | | | | - Typo fixes across json ext
* | Fix documentation wordingFlorian Frank2014-07-031-1/+1
|/
* Security fix create_additons/JSON::GenericObjectv1.7.7Florian Frank2013-02-111-1/+1
|
* Change actual rl filessferik-max_nestingFlorian Frank2012-10-071-3/+3
|
* Throw exception unless source is a stringFlorian Frank2012-04-271-0/+1
|
* The behavior of reference to inner defined variable is undefined.NARUSE, Yui2012-01-151-1/+1
| | | | | https://bugs.ruby-lang.org/issues/5888 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51862
* Support hash ducktype objects on JRuby as wellFlorian Frank2011-12-201-5/+5
|
* Support object class with duck type hashFlorian Frank2011-12-201-2/+8
|
* Move fbuffer in its own directoryFlorian Frank2011-11-281-1/+1
|
* avoid symlinkFlorian Frank2011-11-231-1/+1
|
* Extract fbuffer and use it in parser and generatorFlorian Frank2011-11-231-2/+11
|
* always raise type error when parsing nilFlorian Frank2011-11-031-0/+1
|
* Implement quirks_modeFlorian Frank2011-07-271-53/+124
| | | | This allows parsing of primitive values
* Duplicate the argument of convert_encoding() only.Nobuyoshi Nakada2011-07-081-0/+1
|
* Adjust indent.Nobuyoshi Nakada2011-07-081-2/+2
|
* no force_encodingNobuyoshi Nakada2011-07-081-15/+5
| | | | | * ext/json/ext/parser/parser.rl (JSON_parse_string): no needs to use force_encoding.
* * ext/json/ext/parser/parser.h (GET_PARSER): raise TypeError.nobu2011-07-071-1/+1
| | | | | | * ext/json/ext/parser/parser.rl (cParser_initialize): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30792 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/json/ext/parser/parser.h (GET_PARSER): check if initialized. ↵nobu2011-07-071-1/+6
| | | | | | | | [ruby-core:35079] * ext/json/ext/parser/parser.rl (cParser_initialize): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30791 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/json/ext/parser/parser.rl: add local variables for emacs.nobu2011-07-071-10/+17
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30790 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* clean up superflous tabsFlorian Frank2011-06-151-6/+6
|
* Don't optimize calls for ducktypesFlorian Frank2011-05-121-3/+9
|
* If a custom :object_class is given, the C extension should not use ↵Jon Leighton2011-05-111-1/+5
| | | | rb_hash_aset - it should call the object's []= method instead.