Fix MEMMOVE in rb_darray_insert
Ruby's MEMMOVE takes in the element data type for the third argument, not the size of the element. What this did was do sizeof(sizeof( ... )) which always returned sizeof(size_t).
This commit is contained in:
parent
13e6fe9bbc
commit
07e89bde46
Notes:
git
2024-12-24 14:40:30 +00:00
2
darray.h
2
darray.h
@ -58,7 +58,7 @@
|
||||
MEMMOVE( \
|
||||
rb_darray_ref(*(ptr_to_ary), idx + 1), \
|
||||
rb_darray_ref(*(ptr_to_ary), idx), \
|
||||
sizeof((*(ptr_to_ary))->data[0]), \
|
||||
(*(ptr_to_ary))->data[0], \
|
||||
rb_darray_size(*(ptr_to_ary)) - idx); \
|
||||
rb_darray_set(*(ptr_to_ary), idx, element); \
|
||||
(*(ptr_to_ary))->meta.size++; \
|
||||
|
Loading…
x
Reference in New Issue
Block a user