You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Rework platform_buffer_create() to take platform_heap_id hid as arg. Fix (minor) latent bug in this routine. #507
platform_buffer_create() currently takes platform_heap_handle UNUSED_PARAM(heap_handle) as the arg to specify the "heap"-handle from which a new mmap()-ed buffer will be created.
Currently, in Splinter, heap_id is NULL, and we fall-back to using malloc(). The heap is used to allocte buffer_handle *bh structure.
Right now, things work ok. In a future dev effort, we are looking to support alternate memory handles, say, a shared-memory segment from which stuff like bh can be allocated. The platform_buffer_create() uses platform_get_heap_id() to access the heap-ID to allocate from (and that's anyway NULL right now).
This issue is being raised to make couple of small changes:
Change the interface of platform_buffer_create() to take heap_id as its argument. In future, this will make it easier to drop-in support for other sources of heap-memory given by the heap-ID.
There is a minor bug in the current code. This function could access a NULL bh if ever TYPED_MALLOC() were to fail. This code chunk will seg-fault:
Activity
(#507) Minor rework of platform_buffer_create()/destroy() interfaces.
(#507) Minor rework of platform_buffer_create()/destroy() interfaces.
(#507) Minor rework of platform_buffer_create()/destroy() interfaces.
(#507) Minor rework of platform_buffer_create()/destroy() interfaces.
(#507) Rework of platform_buffer_create()/destroy() to init/deinit() …
(#507) Rework of platform_buffer_create()/destroy() to init/deinit() …
(#507) Rework of platform_buffer_create()/destroy() to init/deinit() …
(#507) Rework of platform_buffer_create()/destroy() to init/deinit() …
Squashed commit of the following: