From af4e408555659f42db5b8c9a1d6a68143b2328da Mon Sep 17 00:00:00 2001 From: Thomas Martitz Date: Wed, 29 May 2013 07:07:34 +0200 Subject: buflib: Change buflib_available() and add buflib_allocatable(). buflib_allocatable() is what buflib_available() was before (it was in fact simply renamed). It returns the largest contiguous block of memory. This can be allocated and will definitely succeed, although larger allocations may also succeed if the buffer can be compacted and shrinked. buflib_available() now counts all free bytes, contiguous or not. This better matches the description and how the caller use it. Change-Id: I511e4eb5f4cf1821d957b3f4ef8a685ce40fe289 Reviewed-on: http://gerrit.rockbox.org/481 Reviewed-by: Thomas Martitz Tested-by: Thomas Martitz --- firmware/include/core_alloc.h | 1 + 1 file changed, 1 insertion(+) (limited to 'firmware/include/core_alloc.h') diff --git a/firmware/include/core_alloc.h b/firmware/include/core_alloc.h index d234947..a100b7c 100644 --- a/firmware/include/core_alloc.h +++ b/firmware/include/core_alloc.h @@ -16,6 +16,7 @@ int core_alloc_maximum(const char* name, size_t *size, struct buflib_callbacks * 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); /* DO NOT ADD wrappers for buflib_buffer_out/in. They do not call * the move callbacks and are therefore unsafe in the core */ -- cgit v1.1