summaryrefslogtreecommitdiff
path: root/firmware/include/core_alloc.h (follow)
Commit message (Collapse)AuthorAge
* buflib: Properly support allocations without any name, to avoid wasting spaceThomas Martitz2014-02-02
| | | | | | in micro-allocation scenarios. Change-Id: I97a065bcfba8e0fda9b1670445e839e267c769c8
* buflib: Add crc field protecting buflib cookie integrityMarcin Bukat2014-01-16
| | | | | | | | | | | | | | | This should catch the case of buffer misuse which results in corrupted cookie of next allocation. The check is performed on move_block() so it may be a bit late. There is buflib_check_valid() provided which checks the integrity of all cookies for given context. On DEBUG build with --sdl-thread this check is carried out for core_ctx on every context switch to catch problems earlier. Change-Id: I999d4576084592394e3dbd3bdf0f32935ff5f601 Reviewed-on: http://gerrit.rockbox.org/711 Reviewed-by: Thomas Martitz <kugel@rockbox.org>
* buflib: Change buflib_available() and add buflib_allocatable().Thomas Martitz2013-07-07
| | | | | | | | | | | | | | | 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>
* Add more INIT_ATTR and add config.h includes to header files with INIT_ATTR.Boris Gjenero2011-12-19
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31370 a1c6a512-1295-4272-9138-f99709370657
* core_alloc: Provide a tiny test allocation, which can be freed for debug ↵Thomas Martitz2011-10-05
| | | | | | | | | | purposes. This allocation can be freed in the buflib debug menu (select it to free). Doing a another allocation, e.g. by selecting another item in this debug menu will cause compaction (all allocs move). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30719 a1c6a512-1295-4272-9138-f99709370657
* FS#12273 - use buflib for font storage. thanks to the testers :)Jonathan Gordon2011-09-24
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30589 a1c6a512-1295-4272-9138-f99709370657
* GSoC/Buflib: Add buflib memory alocator to the core.Thomas Martitz2011-08-30
The buflib memory allocator is handle based and can free and compact, move or resize memory on demand. This allows to effeciently allocate memory dynamically without an MMU, by avoiding fragmentation through memory compaction. This patch adds the buflib library to the core, along with convinience wrappers to omit the context parameter. Compaction is not yet enabled, but will be in a later patch. Therefore, this acts as a replacement for buffer_alloc/buffer_get_buffer() with the benifit of a debug menu. See buflib.h for some API documentation. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30380 a1c6a512-1295-4272-9138-f99709370657