summaryrefslogtreecommitdiffhomepage
path: root/src/array.c
AgeCommit message (Collapse)Author
2017-08-11Remove unnecessary inline function `ary_elt`.Yukihiro "Matz" Matsumoto
And the function does not conform the naming convention anyway.
2017-08-05Fixed heap buffer overflow in `mrb_ary_unshift_m`; fix #3760Yukihiro "Matz" Matsumoto
2017-07-27Embed small size array elements in the heap.Yukihiro "Matz" Matsumoto
It reduces the memory consumption and sometimes improve the performance as well. For example, the consumed memory size of `bench/bm_ao_render.rb` is reduced from 1.2GB to 1GB, and its total execution time become 18.795 sec from 22.229 sec.
2017-07-12Use "$!" specifier of `mrb_get_args`.Yukihiro "Matz" Matsumoto
2017-07-12Add `ary_modify_check()` to `Array#unshift`; ref #3737Yukihiro "Matz" Matsumoto
2017-07-09Should only check frozen for Array#popksss
2017-07-09Should only check frozen fix #3737ksss
2017-06-20Array size can be cause integer overflow; fix #3710Yukihiro "Matz" Matsumoto
2017-06-17Use `mrb_int` instead of `size_t` for array capacity and length.Yukihiro "Matz" Matsumoto
2017-05-31Prevent splicing big recursive arrrays; ref #3679Yukihiro "Matz" Matsumoto
We know this is not perfect, but this change makes hack like #3679 bit harder. Harmless for useful cases.
2017-04-25Silence warnings caused by implicit type casting.Yukihiro "Matz" Matsumoto
2017-04-01Add alias "append" to Array#push, and "prepend" to Array#unshift.Yukihiro "Matz" Matsumoto
According to CRuby [Feature#12746]
2017-03-29Set proper class to subclass of Arrayokkez
More compatibility to CRuby.
2017-03-19Should not check/call `to_str` for immediate objects; ref #3515Yukihiro "Matz" Matsumoto
2017-03-19Need not to call mrb_obj_as_string() is sep is nil.Yukihiro "Matz" Matsumoto
2017-01-24Use size_t to avoid integer overflow in mrb_ary_splice(); fix #3413Yukihiro "Matz" Matsumoto
2017-01-23Refactoring: Use array_copy instead of for loopksss
2017-01-23Changed the behavior of mrb_range_beg_len(); close #3411Yukihiro "Matz" Matsumoto
The new API is: int mrb_range_beg_len(mrb, range, &beg, &len, len, trunc) The new argument `trunc` is a boolean value that specifies whether the function truncates the range. The new return value is an integer instead of a boolean, that is: 0: not a range 1: range with proper edges 2: out of range To get the old behavior, you have to rewrite: mrb_range_beg_len(mrb, range, &beg, &len, len) to: mrn_range_beg_len(mrb, range, &beg, &len, len, TRUE) == 1 [Breaking Change]
2017-01-23Use mrb_write_barrier() instead of mrb_field_write_barrier_value()Yukihiro "Matz" Matsumoto
ref #3409
2017-01-23Remove unnecessary inline declaration; ref #3409Yukihiro "Matz" Matsumoto
2017-01-23Merge pull request #3409 from ksss/mrb_ary_spliceYukihiro "Matz" Matsumoto
Rewrite mrb_ary_splice
2017-01-22Should raise RuntimeError when object frozenksss
2017-01-22Rewrite mrb_ary_spliceksss
Referenced to CRuby's array.c(rb_ary_splice) fix #3405
2017-01-07Add ary_modify() checks; close #3379Yukihiro "Matz" Matsumoto
This issue was reported by https://hackerone.com/an0n-j
2017-01-06Improve capacity enhancing conditionsYukihiro "Matz" Matsumoto
2016-12-31ary_expand_capa(): refine conditions to avoid infinite loop; ref #3353Yukihiro "Matz" Matsumoto
2016-12-31ary_expand_capa(): size calculation by size_t; fix #3353Yukihiro "Matz" Matsumoto
Also more size checks added.
2016-12-27Check array max sizeksss
Fix #3354
2016-12-18Add "not reached" mark in mrb_ary_concat()Yukihiro "Matz" Matsumoto
2016-12-12rename prefix RBASIC_ to MRB_; ref #3340Yukihiro "Matz" Matsumoto
2016-12-11Implement Object#freezeTakashi Kokubun
2016-12-01Fix more integer overflows.Clayton Smith
2016-12-01Fix compile error by #3309Yukihiro "Matz" Matsumoto
2016-11-30Prevent array size calculation overflows.Clayton Smith
2016-11-29Use size_t to calculate bytes needed for array.Clayton Smith
2016-11-29ary_concat: support self concatenation; fix #3302Yukihiro "Matz" Matsumoto
2016-11-24fixed a bug in self modifying Array#[]=; fix #3274Yukihiro "Matz" Matsumoto
2016-11-16Fixed rindex calling into mrb_equal bugYukihiro "Matz" Matsumoto
Fixed by Alex Snaps and reported by Mathieu Leduc-Hamel, both from shopify.com. Thank you!
2016-11-16Fixed a memory problem in Array#to_hYukihiro "Matz" Matsumoto
Reported from Alex Snaps via Mathieu Leduc-Hamel, both from shopify.com. Thank you!
2016-09-08Fix SEGV when splat objectksss
Splat operation should return an array. And raise an error if result of convert by to_a is not array or nil.
2015-11-27include changed from by quotes ("") to by brackets (<>); close #3032Yukihiro "Matz" Matsumoto
2015-10-20Increasing docs coverageSeba Gamboa
2015-10-01Array#index to take block; fix #2968 close #2970Yukihiro "Matz" Matsumoto
2015-08-12Remove duplicated RARRAY_LEN checkgo.kikuta
2015-07-13use "S!" specifier of mrb_get_args() to improve #2882 fix.Yukihiro "Matz" Matsumoto
2015-07-11Removing unndeeded to_sjbreeden
2015-07-11Patching array joinjbreeden
2015-06-03Merge pull request #2823 from cremno/remove-unnecessary-mrb_immediate_pYukihiro "Matz" Matsumoto
remove unnecessary mrb_immediate_p()
2015-06-02remove unnecessary mrb_immediate_p()cremno
`!mrb_array_p(ary2)` and `mrb_type(obj) != MRB_TT_DATA` are sufficient.
2015-06-02directly call ary_new_capa()cremno