mirror of
https://github.com/ruby/ruby.git
synced 2026-01-26 12:14:51 +00:00
rb_free_tmp_buffer: use ruby_sized_xfree
We know the buffer length, we might as well feed that information back to the GC.
This commit is contained in:
parent
3164d4e8a2
commit
1c7e19f961
Notes:
git
2026-01-16 20:11:47 +00:00
3
imemo.c
3
imemo.c
@ -94,8 +94,9 @@ rb_free_tmp_buffer(volatile VALUE *store)
|
||||
rb_imemo_tmpbuf_t *s = (rb_imemo_tmpbuf_t*)ATOMIC_VALUE_EXCHANGE(*store, 0);
|
||||
if (s) {
|
||||
void *ptr = ATOMIC_PTR_EXCHANGE(s->ptr, 0);
|
||||
long cnt = s->cnt;
|
||||
s->cnt = 0;
|
||||
ruby_xfree(ptr);
|
||||
ruby_sized_xfree(ptr, sizeof(VALUE) * cnt);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user