1
0
Fork 0
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:
Thomas Martitz 2014-02-02 14:43:45 +01:00
parent d66346789c
commit 4ce1deacfd
4 changed files with 27 additions and 22 deletions

View file

@ -17,6 +17,7 @@ bool core_shrink(int handle, void* new_start, size_t new_size);
int core_free(int handle);
size_t core_available(void);
size_t core_allocatable(void);
const char* core_get_name(int handle);
#ifdef DEBUG
void core_check_valid(void);
#endif
@ -43,10 +44,4 @@ static inline void* core_get_data(int handle)
return buflib_get_data(&core_ctx, handle);
}
static inline const char* core_get_name(int handle)
{
extern struct buflib_context core_ctx;
return buflib_get_name(&core_ctx, handle);
}
#endif /* __CORE_ALLOC_H__ */