summaryrefslogtreecommitdiffstats
path: root/firmware/core_alloc.c
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2014-02-02 14:43:45 +0100
committerThomas Martitz <kugel@rockbox.org>2014-02-02 19:40:38 +0100
commit4ce1deacfd4e5440cc82237ebc5fafbaeea64763 (patch)
tree7ff4664819704fd890d3e5ea95349c8500f9c4c7 /firmware/core_alloc.c
parentd66346789ccdf685a6720a739b88f194f56a60e2 (diff)
downloadrockbox-4ce1deacfd4e5440cc82237ebc5fafbaeea64763.tar.gz
rockbox-4ce1deacfd4e5440cc82237ebc5fafbaeea64763.tar.bz2
rockbox-4ce1deacfd4e5440cc82237ebc5fafbaeea64763.zip
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.c6
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);