diff options
author | Aidan MacDonald <amachronic@protonmail.com> | 2022-10-15 23:55:39 +0100 |
---|---|---|
committer | Aidan MacDonald <amachronic@protonmail.com> | 2023-01-13 10:32:54 +0000 |
commit | 1e9ad3ca0d9bf3e917eb2beb460421155144760a (patch) | |
tree | 752590b42f338f03223e024fc5b642ac9a8a5598 /firmware/core_alloc.c | |
parent | 3301c5aa6db76832dbb9af8f72d29b348190fd91 (diff) | |
download | rockbox-1e9ad3ca0d9bf3e917eb2beb460421155144760a.tar.gz rockbox-1e9ad3ca0d9bf3e917eb2beb460421155144760a.zip |
Remove buflib allocation names, part two
Remove allocation names from the buflib API and fix up all callers.
Change-Id: I3df922e258d5f0d711d70e72b56b4ed634fb0f5a
Diffstat (limited to 'firmware/core_alloc.c')
-rw-r--r-- | firmware/core_alloc.c | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/firmware/core_alloc.c b/firmware/core_alloc.c index 0374c801c1..f5cc7f3189 100644 --- a/firmware/core_alloc.c +++ b/firmware/core_alloc.c | |||
@@ -51,7 +51,7 @@ void core_allocator_init(void) | |||
51 | 51 | ||
52 | buflib_init(&core_ctx, start, audiobufend - start); | 52 | buflib_init(&core_ctx, start, audiobufend - start); |
53 | 53 | ||
54 | test_alloc = core_alloc("test", 112); | 54 | test_alloc = core_alloc(112); |
55 | } | 55 | } |
56 | 56 | ||
57 | bool core_test_free(void) | 57 | bool core_test_free(void) |
@@ -69,14 +69,14 @@ bool core_test_free(void) | |||
69 | * Note: Buffers allocated by this functions are movable. | 69 | * Note: Buffers allocated by this functions are movable. |
70 | * Don't pass them to functions that call yield() | 70 | * Don't pass them to functions that call yield() |
71 | * like disc input/output. */ | 71 | * like disc input/output. */ |
72 | int core_alloc(const char* name, size_t size) | 72 | int core_alloc(size_t size) |
73 | { | 73 | { |
74 | return buflib_alloc_ex(&core_ctx, size, name, NULL); | 74 | return buflib_alloc_ex(&core_ctx, size, NULL); |
75 | } | 75 | } |
76 | 76 | ||
77 | int core_alloc_ex(const char* name, size_t size, struct buflib_callbacks *ops) | 77 | int core_alloc_ex(size_t size, struct buflib_callbacks *ops) |
78 | { | 78 | { |
79 | return buflib_alloc_ex(&core_ctx, size, name, ops); | 79 | return buflib_alloc_ex(&core_ctx, size, ops); |
80 | } | 80 | } |
81 | 81 | ||
82 | size_t core_available(void) | 82 | size_t core_available(void) |
@@ -94,9 +94,9 @@ int core_free(int handle) | |||
94 | return buflib_free(&core_ctx, handle); | 94 | return buflib_free(&core_ctx, handle); |
95 | } | 95 | } |
96 | 96 | ||
97 | int core_alloc_maximum(const char* name, size_t *size, struct buflib_callbacks *ops) | 97 | int core_alloc_maximum(size_t *size, struct buflib_callbacks *ops) |
98 | { | 98 | { |
99 | return buflib_alloc_maximum(&core_ctx, name, size, ops); | 99 | return buflib_alloc_maximum(&core_ctx, size, ops); |
100 | } | 100 | } |
101 | 101 | ||
102 | bool core_shrink(int handle, void* new_start, size_t new_size) | 102 | bool core_shrink(int handle, void* new_start, size_t new_size) |
@@ -119,12 +119,6 @@ unsigned core_pin_count(int handle) | |||
119 | return buflib_pin_count(&core_ctx, handle); | 119 | return buflib_pin_count(&core_ctx, handle); |
120 | } | 120 | } |
121 | 121 | ||
122 | const char* core_get_name(int handle) | ||
123 | { | ||
124 | const char *name = buflib_get_name(&core_ctx, handle); | ||
125 | return name ?: "<anonymous>"; | ||
126 | } | ||
127 | |||
128 | int core_get_num_blocks(void) | 122 | int core_get_num_blocks(void) |
129 | { | 123 | { |
130 | return buflib_get_num_blocks(&core_ctx); | 124 | return buflib_get_num_blocks(&core_ctx); |