forked from len0rd/rockbox
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 <kugel@rockbox.org> Tested-by: Thomas Martitz <kugel@rockbox.org>
This commit is contained in:
parent
f9e47c6886
commit
af4e408555
4 changed files with 41 additions and 7 deletions
|
|
@ -67,6 +67,11 @@ size_t core_available(void)
|
|||
return buflib_available(&core_ctx);
|
||||
}
|
||||
|
||||
size_t core_allocatable(void)
|
||||
{
|
||||
return buflib_allocatable(&core_ctx);
|
||||
}
|
||||
|
||||
int core_free(int handle)
|
||||
{
|
||||
return buflib_free(&core_ctx, handle);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue