Of course, I know that we can implement a similar function in extension library using rb_gc_adjust_memory_usage().
However, if Ruby have the API, we can easily use it in some extension libraries.
I'm not in favor of this. There are many ways to allocate a memory region, like mmap(2). Do we have to provide ruby counterparts for every and all of them?
I'm not in favor of this. There are many ways to allocate a memory region, like mmap(2). Do we have to provide ruby counterparts for every and all of them?
I'm not in favor of this. There are many ways to allocate a memory region, like mmap(2). Do we have to provide ruby counterparts for every and all of them?
rb_aligned_malloc uses 5 underlying implementations.
It's hard to make C-extension developer to re-develop this.
In case of this request, ImageMagick already does have aligned allocator. If we provide one we would use any of 5 backends but that is not required at all. They already have it. What is wanted is a way to notify ruby about their memory usage.