summaryrefslogtreecommitdiff
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.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)
87 return buflib_shrink(&core_ctx, handle, new_start, new_size); 87 return buflib_shrink(&core_ctx, handle, new_start, new_size);
88} 88}
89 89
90const char* core_get_name(int handle)
91{
92 const char *name = buflib_get_name(&core_ctx, handle);
93 return name ?: "<anonymous>";
94}
95
90int core_get_num_blocks(void) 96int core_get_num_blocks(void)
91{ 97{
92 return buflib_get_num_blocks(&core_ctx); 98 return buflib_get_num_blocks(&core_ctx);