diff options
author | Maxime Chevalier-Boisvert <maximechevalierb@gmail.com> | 2021-04-19 17:07:27 -0400 |
---|---|---|
committer | Alan Wu <XrXr@users.noreply.github.com> | 2021-10-20 18:19:33 -0400 |
commit | 0cc73ca2a9a2aa5276cd022be9891475a15ecee3 (patch) | |
tree | 7089bb4d352277b6129c7e3af7444ff09f548c0a /darray.h | |
parent | 33c975b813a2be9fb02e526b7a63096dff385614 (diff) |
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.
Diffstat (limited to 'darray.h')
-rw-r--r-- | darray.h | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -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) \ |