diff options
author | Thomas Martitz <kugel@rockbox.org> | 2014-02-02 14:43:45 +0100 |
---|---|---|
committer | Thomas Martitz <kugel@rockbox.org> | 2014-02-02 19:40:38 +0100 |
commit | 4ce1deacfd4e5440cc82237ebc5fafbaeea64763 (patch) | |
tree | 7ff4664819704fd890d3e5ea95349c8500f9c4c7 /firmware/core_alloc.c | |
parent | d66346789ccdf685a6720a739b88f194f56a60e2 (diff) |
buflib: Properly support allocations without any name, to avoid wasting space
in micro-allocation scenarios.
Change-Id: I97a065bcfba8e0fda9b1670445e839e267c769c8
Diffstat (limited to 'firmware/core_alloc.c')
-rw-r--r-- | firmware/core_alloc.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/firmware/core_alloc.c b/firmware/core_alloc.c index 68c400f669..58e12141e1 100644 --- a/firmware/core_alloc.c +++ b/firmware/core_alloc.c @@ -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); |