mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Malloc branch entries (#112)
* Malloc branch entries * Add ASM comment for stack overflow check * WIP * Fix branch GC code. Add rb_darray_remove_unordered(). * Fix block end_pos after branch rewriting. Remove dst_patched bits.
This commit is contained in:
parent
33c975b813
commit
0cc73ca2a9
5 changed files with 176 additions and 152 deletions
10
darray.h
10
darray.h
|
@ -51,10 +51,20 @@
|
|||
1 \
|
||||
) : 0)
|
||||
|
||||
// Last element of the array
|
||||
//
|
||||
#define rb_darray_back(ary) ((ary)->data[(ary)->meta.size - 1])
|
||||
|
||||
// Remove the last element of the array.
|
||||
//
|
||||
#define rb_darray_pop_back(ary) ((ary)->meta.size--)
|
||||
|
||||
// Remove element at idx and replace it by the last element
|
||||
#define rb_darray_remove_unordered(ary, idx) do { \
|
||||
rb_darray_set(ary, idx, rb_darray_back(ary)); \
|
||||
rb_darray_pop_back(ary); \
|
||||
} while (0);
|
||||
|
||||
// Iterate over items of the array in a for loop
|
||||
//
|
||||
#define rb_darray_foreach(ary, idx_name, elem_ptr_var) \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue