mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Add mrb_alloca again; ref #4470
This time, the allocated memory comes from the string object, which is referenced from GC arena. The memory region will be reclaimed when the C function called from VM is terminated, or the GC arena is restored.
This commit is contained in:
@@ -1246,6 +1246,8 @@ MRB_API void mrb_pool_close(struct mrb_pool*);
|
||||
MRB_API void* mrb_pool_alloc(struct mrb_pool*, size_t);
|
||||
MRB_API void* mrb_pool_realloc(struct mrb_pool*, void*, size_t oldlen, size_t newlen);
|
||||
MRB_API mrb_bool mrb_pool_can_realloc(struct mrb_pool*, void*, size_t);
|
||||
/* temporary memory allocation, only effective while GC arena is kept */
|
||||
MRB_API void* mrb_alloca(mrb_state *mrb, size_t);
|
||||
|
||||
MRB_API void mrb_state_atexit(mrb_state *mrb, mrb_atexit_func func);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user