forked from len0rd/rockbox
buflib: Properly support allocations without any name, to avoid wasting space
in micro-allocation scenarios. Change-Id: I97a065bcfba8e0fda9b1670445e839e267c769c8
This commit is contained in:
parent
d66346789c
commit
4ce1deacfd
4 changed files with 27 additions and 22 deletions
|
@ -87,6 +87,12 @@ bool core_shrink(int handle, void* new_start, size_t new_size)
|
|||
return buflib_shrink(&core_ctx, handle, new_start, new_size);
|
||||
}
|
||||
|
||||
const char* core_get_name(int handle)
|
||||
{
|
||||
const char *name = buflib_get_name(&core_ctx, handle);
|
||||
return name ?: "<anonymous>";
|
||||
}
|
||||
|
||||
int core_get_num_blocks(void)
|
||||
{
|
||||
return buflib_get_num_blocks(&core_ctx);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue