1
0
Fork 0
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:
Maxime Chevalier-Boisvert 2021-04-19 17:07:27 -04:00 committed by Alan Wu
parent 33c975b813
commit 0cc73ca2a9
5 changed files with 176 additions and 152 deletions

View file

@ -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) \