From 4ce1deacfd4e5440cc82237ebc5fafbaeea64763 Mon Sep 17 00:00:00 2001 From: Thomas Martitz Date: Sun, 2 Feb 2014 14:43:45 +0100 Subject: buflib: Properly support allocations without any name, to avoid wasting space in micro-allocation scenarios. Change-Id: I97a065bcfba8e0fda9b1670445e839e267c769c8 --- firmware/core_alloc.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'firmware/core_alloc.c') 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 ?: ""; +} + int core_get_num_blocks(void) { return buflib_get_num_blocks(&core_ctx); -- cgit v1.2.3