Commit graph

3 commits

Author SHA1 Message Date
Aidan MacDonald
a9b93bb4cd buflib_malloc: fixed signed/unsigned comparison
Change-Id: Ie346759a0dda96debd8448fd44ca3e86d40ef348
2023-01-16 16:57:23 +00:00
Aidan MacDonald
800bc000a0 buflib: Add pinned get/put data functions
These are more efficient than separate pin/unpin calls because
pin count increment and decrement can be done cheaply when the
data pointer is known.

Secondly, pinned access can be made safe against preemption by
hardware interrupts or other CPU cores; buflib_get_data() can't.
This makes it more useful under different threading models and
for SMP targets; both of which are not particularly relevant to
Rockbox now, but might be in the future.

Change-Id: I09284251b83bbbc59ef88a494c8fda26a7f7ef26
2023-01-15 11:06:27 +00:00
Aidan MacDonald
92565e9246 buflib: Add malloc-backed buflib
This is intended for improving the effectiveness of tools like
ASAN when debugging memory errors in the sim. It's not meant to
be a serious allocator for hosted targets.

Enable it by changing the buflib backend in config.h.

Change-Id: I0cf23cefa47ee35dede7b49e0e5b72dac60e8d3e
2023-01-15 10:04:13 +00:00