diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/action.c | 2 | ||||
-rw-r--r-- | apps/core_keymap.c | 2 | ||||
-rw-r--r-- | apps/debug_menu.c | 2 | ||||
-rw-r--r-- | apps/filetypes.c | 2 | ||||
-rw-r--r-- | apps/gui/skin_engine/skin_backdrops.c | 5 | ||||
-rw-r--r-- | apps/gui/skin_engine/skin_parser.c | 3 | ||||
-rw-r--r-- | apps/iap/iap-core.c | 2 | ||||
-rw-r--r-- | apps/misc.c | 4 | ||||
-rw-r--r-- | apps/playback.c | 2 | ||||
-rw-r--r-- | apps/playlist.c | 9 | ||||
-rw-r--r-- | apps/plugin.c | 4 | ||||
-rw-r--r-- | apps/plugin.h | 5 | ||||
-rw-r--r-- | apps/radio/radioart.c | 2 | ||||
-rw-r--r-- | apps/rbcodec_helpers.c | 2 | ||||
-rw-r--r-- | apps/recorder/pcm_record.c | 2 | ||||
-rw-r--r-- | apps/shortcuts.c | 9 | ||||
-rw-r--r-- | apps/tagcache.c | 6 | ||||
-rw-r--r-- | apps/tagtree.c | 2 | ||||
-rw-r--r-- | apps/talk.c | 4 | ||||
-rw-r--r-- | apps/tree.c | 9 | ||||
-rw-r--r-- | apps/voice_thread.c | 2 |
21 files changed, 33 insertions, 47 deletions
diff --git a/apps/action.c b/apps/action.c index 20145a5bc1..208fea4a97 100644 --- a/apps/action.c +++ b/apps/action.c | |||
@@ -1202,7 +1202,7 @@ int action_set_keymap(struct button_mapping* core_keymap, int count) | |||
1202 | return action_set_keymap_handle(0, 0); | 1202 | return action_set_keymap_handle(0, 0); |
1203 | 1203 | ||
1204 | size_t keyremap_buf_size = count * sizeof(struct button_mapping); | 1204 | size_t keyremap_buf_size = count * sizeof(struct button_mapping); |
1205 | int handle = core_alloc("keyremap", keyremap_buf_size); | 1205 | int handle = core_alloc(keyremap_buf_size); |
1206 | if (handle < 0) | 1206 | if (handle < 0) |
1207 | return -6; | 1207 | return -6; |
1208 | 1208 | ||
diff --git a/apps/core_keymap.c b/apps/core_keymap.c index 9d54fcffac..966f32057a 100644 --- a/apps/core_keymap.c +++ b/apps/core_keymap.c | |||
@@ -77,7 +77,7 @@ int core_load_key_remap(const char *filename) | |||
77 | return -1; | 77 | return -1; |
78 | 78 | ||
79 | size_t bufsize = count * sizeof(struct button_mapping); | 79 | size_t bufsize = count * sizeof(struct button_mapping); |
80 | int handle = core_alloc("keyremap", bufsize); | 80 | int handle = core_alloc(bufsize); |
81 | if (handle > 0) | 81 | if (handle > 0) |
82 | { | 82 | { |
83 | core_pin(handle); | 83 | core_pin(handle); |
diff --git a/apps/debug_menu.c b/apps/debug_menu.c index 71c0395e6e..65b660813f 100644 --- a/apps/debug_menu.c +++ b/apps/debug_menu.c | |||
@@ -515,7 +515,7 @@ static int bf_action_cb(int action, struct gui_synclist* list) | |||
515 | else | 515 | else |
516 | { | 516 | { |
517 | splash(HZ/1, "Attempting a 64k allocation"); | 517 | splash(HZ/1, "Attempting a 64k allocation"); |
518 | int handle = core_alloc("test", 64<<10); | 518 | int handle = core_alloc(64<<10); |
519 | splash(HZ/2, (handle > 0) ? "Success":"Fail"); | 519 | splash(HZ/2, (handle > 0) ? "Success":"Fail"); |
520 | /* for some reason simplelist doesn't allow adding items here if | 520 | /* for some reason simplelist doesn't allow adding items here if |
521 | * info.get_name is given, so use normal list api */ | 521 | * info.get_name is given, so use normal list api */ |
diff --git a/apps/filetypes.c b/apps/filetypes.c index 03f3cfa994..d5cfc379c1 100644 --- a/apps/filetypes.c +++ b/apps/filetypes.c | |||
@@ -409,7 +409,7 @@ static void read_viewers_config_init(void) | |||
409 | 409 | ||
410 | /* estimate bufsize with the filesize, will not be larger */ | 410 | /* estimate bufsize with the filesize, will not be larger */ |
411 | strdup_bufsize = (size_t)filesz; | 411 | strdup_bufsize = (size_t)filesz; |
412 | strdup_handle = core_alloc_ex("filetypes", strdup_bufsize, &ops); | 412 | strdup_handle = core_alloc_ex(strdup_bufsize, &ops); |
413 | if(strdup_handle <= 0) | 413 | if(strdup_handle <= 0) |
414 | goto out; | 414 | goto out; |
415 | 415 | ||
diff --git a/apps/gui/skin_engine/skin_backdrops.c b/apps/gui/skin_engine/skin_backdrops.c index 8be40d1ce2..eecf5b0433 100644 --- a/apps/gui/skin_engine/skin_backdrops.c +++ b/apps/gui/skin_engine/skin_backdrops.c | |||
@@ -174,7 +174,7 @@ bool skin_backdrops_preload(void) | |||
174 | } | 174 | } |
175 | if (*filename && *filename != '-') | 175 | if (*filename && *filename != '-') |
176 | { | 176 | { |
177 | backdrops[i].buflib_handle = core_alloc_ex(filename, buf_size, &buflib_ops); | 177 | backdrops[i].buflib_handle = core_alloc_ex(buf_size, &buflib_ops); |
178 | if (backdrops[i].buflib_handle > 0) | 178 | if (backdrops[i].buflib_handle > 0) |
179 | { | 179 | { |
180 | backdrops[i].buffer = core_get_data(backdrops[i].buflib_handle); | 180 | backdrops[i].buffer = core_get_data(backdrops[i].buflib_handle); |
@@ -287,8 +287,7 @@ void skin_backdrop_load_setting(void) | |||
287 | if (backdrops[i].buflib_handle <= 0) | 287 | if (backdrops[i].buflib_handle <= 0) |
288 | { | 288 | { |
289 | backdrops[i].buflib_handle = | 289 | backdrops[i].buflib_handle = |
290 | core_alloc_ex(global_settings.backdrop_file, | 290 | core_alloc_ex(LCD_BACKDROP_BYTES, &buflib_ops); |
291 | LCD_BACKDROP_BYTES, &buflib_ops); | ||
292 | if (backdrops[i].buflib_handle <= 0) | 291 | if (backdrops[i].buflib_handle <= 0) |
293 | return; | 292 | return; |
294 | } | 293 | } |
diff --git a/apps/gui/skin_engine/skin_parser.c b/apps/gui/skin_engine/skin_parser.c index d99394eed0..6cc3c596b0 100644 --- a/apps/gui/skin_engine/skin_parser.c +++ b/apps/gui/skin_engine/skin_parser.c | |||
@@ -2574,8 +2574,7 @@ bool skin_data_load(enum screen_type screen, struct wps_data *wps_data, | |||
2574 | } | 2574 | } |
2575 | #endif | 2575 | #endif |
2576 | #ifndef __PCTOOL__ | 2576 | #ifndef __PCTOOL__ |
2577 | wps_data->buflib_handle = core_alloc(isfile ? buf : "failsafe skin", | 2577 | wps_data->buflib_handle = core_alloc(skin_buffer_usage()); |
2578 | skin_buffer_usage()); | ||
2579 | if (wps_data->buflib_handle > 0) | 2578 | if (wps_data->buflib_handle > 0) |
2580 | { | 2579 | { |
2581 | wps_data->wps_loaded = true; | 2580 | wps_data->wps_loaded = true; |
diff --git a/apps/iap/iap-core.c b/apps/iap/iap-core.c index d2095b65bd..da04a67311 100644 --- a/apps/iap/iap-core.c +++ b/apps/iap/iap-core.c | |||
@@ -453,7 +453,7 @@ static void iap_malloc(void) | |||
453 | return; | 453 | return; |
454 | 454 | ||
455 | #ifdef IAP_MALLOC_DYNAMIC | 455 | #ifdef IAP_MALLOC_DYNAMIC |
456 | iap_buffer_handle = core_alloc_ex("iap", IAP_MALLOC_SIZE, &iap_buflib_callbacks); | 456 | iap_buffer_handle = core_alloc_ex(IAP_MALLOC_SIZE, &iap_buflib_callbacks); |
457 | if (iap_buffer_handle < 0) | 457 | if (iap_buffer_handle < 0) |
458 | panicf("Could not allocate buffer memory"); | 458 | panicf("Could not allocate buffer memory"); |
459 | iap_buffers = core_get_data(iap_buffer_handle); | 459 | iap_buffers = core_get_data(iap_buffer_handle); |
diff --git a/apps/misc.c b/apps/misc.c index 36f45d46e0..93b5247ae9 100644 --- a/apps/misc.c +++ b/apps/misc.c | |||
@@ -1606,9 +1606,7 @@ int core_load_bmp(const char * filename, struct bitmap *bm, const int bmformat, | |||
1606 | 1606 | ||
1607 | if (buf_size > 0) | 1607 | if (buf_size > 0) |
1608 | { | 1608 | { |
1609 | 1609 | handle = core_alloc_ex(buf_size, ops); | |
1610 | handle = core_alloc_ex(filename, (size_t) buf_size, ops); | ||
1611 | |||
1612 | if (handle > 0) | 1610 | if (handle > 0) |
1613 | { | 1611 | { |
1614 | core_pin(handle); | 1612 | core_pin(handle); |
diff --git a/apps/playback.c b/apps/playback.c index c4d84145b2..f298764a22 100644 --- a/apps/playback.c +++ b/apps/playback.c | |||
@@ -997,7 +997,7 @@ static void audio_reset_buffer(void) | |||
997 | } | 997 | } |
998 | if (core_allocatable() < (1 << 10)) | 998 | if (core_allocatable() < (1 << 10)) |
999 | talk_buffer_set_policy(TALK_BUFFER_LOOSE); /* back off voice buffer */ | 999 | talk_buffer_set_policy(TALK_BUFFER_LOOSE); /* back off voice buffer */ |
1000 | audiobuf_handle = core_alloc_maximum("audiobuf", &filebuflen, &ops); | 1000 | audiobuf_handle = core_alloc_maximum(&filebuflen, &ops); |
1001 | 1001 | ||
1002 | if (audiobuf_handle > 0) | 1002 | if (audiobuf_handle > 0) |
1003 | audio_reset_buffer_noalloc(core_get_data(audiobuf_handle)); | 1003 | audio_reset_buffer_noalloc(core_get_data(audiobuf_handle)); |
diff --git a/apps/playlist.c b/apps/playlist.c index 25bd60dd2a..481524b9d4 100644 --- a/apps/playlist.c +++ b/apps/playlist.c | |||
@@ -2020,7 +2020,7 @@ static void alloc_namebuffer(void) | |||
2020 | static int alloc_tempbuf(size_t* buflen) | 2020 | static int alloc_tempbuf(size_t* buflen) |
2021 | { | 2021 | { |
2022 | /* request a reasonable size first */ | 2022 | /* request a reasonable size first */ |
2023 | int handle = core_alloc_ex(NULL, PLAYLIST_LOAD_BUFLEN, &buflib_ops_locked); | 2023 | int handle = core_alloc_ex(PLAYLIST_LOAD_BUFLEN, &buflib_ops_locked); |
2024 | if (handle > 0) | 2024 | if (handle > 0) |
2025 | { | 2025 | { |
2026 | *buflen = PLAYLIST_LOAD_BUFLEN; | 2026 | *buflen = PLAYLIST_LOAD_BUFLEN; |
@@ -2028,7 +2028,7 @@ static int alloc_tempbuf(size_t* buflen) | |||
2028 | } | 2028 | } |
2029 | 2029 | ||
2030 | /* otherwise, try being unreasonable */ | 2030 | /* otherwise, try being unreasonable */ |
2031 | return core_alloc_maximum(NULL, buflen, &buflib_ops_locked); | 2031 | return core_alloc_maximum(buflen, &buflib_ops_locked); |
2032 | } | 2032 | } |
2033 | 2033 | ||
2034 | /* | 2034 | /* |
@@ -2075,15 +2075,14 @@ void playlist_init(void) | |||
2075 | playlist->fd = -1; | 2075 | playlist->fd = -1; |
2076 | playlist->control_fd = -1; | 2076 | playlist->control_fd = -1; |
2077 | playlist->max_playlist_size = global_settings.max_files_in_playlist; | 2077 | playlist->max_playlist_size = global_settings.max_files_in_playlist; |
2078 | handle = core_alloc_ex("playlist idx", | ||
2079 | playlist->max_playlist_size * sizeof(*playlist->indices), &ops); | ||
2080 | 2078 | ||
2079 | handle = core_alloc_ex(playlist->max_playlist_size * sizeof(*playlist->indices), &ops); | ||
2081 | playlist->indices = core_get_data(handle); | 2080 | playlist->indices = core_get_data(handle); |
2082 | 2081 | ||
2083 | initalize_new_playlist(playlist, true); | 2082 | initalize_new_playlist(playlist, true); |
2084 | 2083 | ||
2085 | #ifdef HAVE_DIRCACHE | 2084 | #ifdef HAVE_DIRCACHE |
2086 | handle = core_alloc_ex("playlist dc", | 2085 | handle = core_alloc_ex( |
2087 | playlist->max_playlist_size * sizeof(*playlist->dcfrefs), &ops); | 2086 | playlist->max_playlist_size * sizeof(*playlist->dcfrefs), &ops); |
2088 | playlist->dcfrefs = core_get_data(handle); | 2087 | playlist->dcfrefs = core_get_data(handle); |
2089 | dc_copy_filerefs(playlist->dcfrefs, NULL, playlist->max_playlist_size); | 2088 | dc_copy_filerefs(playlist->dcfrefs, NULL, playlist->max_playlist_size); |
diff --git a/apps/plugin.c b/apps/plugin.c index 7c6e91424a..38b7b6e821 100644 --- a/apps/plugin.c +++ b/apps/plugin.c | |||
@@ -585,7 +585,6 @@ static const struct plugin_api rockbox_api = { | |||
585 | buflib_free, | 585 | buflib_free, |
586 | buflib_shrink, | 586 | buflib_shrink, |
587 | buflib_get_data, | 587 | buflib_get_data, |
588 | buflib_get_name, | ||
589 | 588 | ||
590 | /* sound */ | 589 | /* sound */ |
591 | sound_set, | 590 | sound_set, |
@@ -1039,8 +1038,7 @@ static void* plugin_get_audio_buffer(size_t *buffer_size) | |||
1039 | { | 1038 | { |
1040 | if (plugin_buffer_handle <= 0) | 1039 | if (plugin_buffer_handle <= 0) |
1041 | { | 1040 | { |
1042 | plugin_buffer_handle = core_alloc_maximum("plugin audio buf", | 1041 | plugin_buffer_handle = core_alloc_maximum(&plugin_buffer_size, |
1043 | &plugin_buffer_size, | ||
1044 | &buflib_ops_locked); | 1042 | &buflib_ops_locked); |
1045 | } | 1043 | } |
1046 | 1044 | ||
diff --git a/apps/plugin.h b/apps/plugin.h index 768fc0ff27..0e7e97433b 100644 --- a/apps/plugin.h +++ b/apps/plugin.h | |||
@@ -649,8 +649,8 @@ struct plugin_api { | |||
649 | size_t (*buflib_available)(struct buflib_context* ctx); | 649 | size_t (*buflib_available)(struct buflib_context* ctx); |
650 | int (*buflib_alloc)(struct buflib_context* ctx, size_t size); | 650 | int (*buflib_alloc)(struct buflib_context* ctx, size_t size); |
651 | int (*buflib_alloc_ex)(struct buflib_context* ctx, size_t size, | 651 | int (*buflib_alloc_ex)(struct buflib_context* ctx, size_t size, |
652 | const char* name, struct buflib_callbacks *ops); | 652 | struct buflib_callbacks *ops); |
653 | int (*buflib_alloc_maximum)(struct buflib_context* ctx, const char* name, | 653 | int (*buflib_alloc_maximum)(struct buflib_context* ctx, |
654 | size_t* size, struct buflib_callbacks *ops); | 654 | size_t* size, struct buflib_callbacks *ops); |
655 | void (*buflib_buffer_in)(struct buflib_context* ctx, int size); | 655 | void (*buflib_buffer_in)(struct buflib_context* ctx, int size); |
656 | void* (*buflib_buffer_out)(struct buflib_context* ctx, size_t* size); | 656 | void* (*buflib_buffer_out)(struct buflib_context* ctx, size_t* size); |
@@ -658,7 +658,6 @@ struct plugin_api { | |||
658 | bool (*buflib_shrink)(struct buflib_context* ctx, int handle, | 658 | bool (*buflib_shrink)(struct buflib_context* ctx, int handle, |
659 | void* new_start, size_t new_size); | 659 | void* new_start, size_t new_size); |
660 | void* (*buflib_get_data)(struct buflib_context* ctx, int handle); | 660 | void* (*buflib_get_data)(struct buflib_context* ctx, int handle); |
661 | const char* (*buflib_get_name)(struct buflib_context* ctx, int handle); | ||
662 | 661 | ||
663 | /* sound */ | 662 | /* sound */ |
664 | void (*sound_set)(int setting, int value); | 663 | void (*sound_set)(int setting, int value); |
diff --git a/apps/radio/radioart.c b/apps/radio/radioart.c index 230948c051..ce774ac4b1 100644 --- a/apps/radio/radioart.c +++ b/apps/radio/radioart.c | |||
@@ -202,7 +202,7 @@ void radioart_init(bool entering_screen) | |||
202 | { | 202 | { |
203 | /* grab control over buffering */ | 203 | /* grab control over buffering */ |
204 | size_t bufsize; | 204 | size_t bufsize; |
205 | int handle = core_alloc_maximum("radioart", &bufsize, &radioart_ops); | 205 | int handle = core_alloc_maximum(&bufsize, &radioart_ops); |
206 | if (handle <0) | 206 | if (handle <0) |
207 | { | 207 | { |
208 | splash(HZ, "Radioart Failed - OOM"); | 208 | splash(HZ, "Radioart Failed - OOM"); |
diff --git a/apps/rbcodec_helpers.c b/apps/rbcodec_helpers.c index b856d7355d..197c0d4595 100644 --- a/apps/rbcodec_helpers.c +++ b/apps/rbcodec_helpers.c | |||
@@ -64,7 +64,7 @@ bool tdspeed_alloc_buffers(int32_t **buffers, const int *buf_s, int nbuf) | |||
64 | { | 64 | { |
65 | if (handles[i] <= 0) | 65 | if (handles[i] <= 0) |
66 | { | 66 | { |
67 | handles[i] = core_alloc_ex("tdspeed", buf_s[i], &ops); | 67 | handles[i] = core_alloc_ex(buf_s[i], &ops); |
68 | 68 | ||
69 | if (handles[i] <= 0) | 69 | if (handles[i] <= 0) |
70 | return false; | 70 | return false; |
diff --git a/apps/recorder/pcm_record.c b/apps/recorder/pcm_record.c index f7f4c77928..8dc2c150fd 100644 --- a/apps/recorder/pcm_record.c +++ b/apps/recorder/pcm_record.c | |||
@@ -1408,7 +1408,7 @@ static void on_init_recording(void) | |||
1408 | send_event(RECORDING_EVENT_START, NULL); | 1408 | send_event(RECORDING_EVENT_START, NULL); |
1409 | /* FIXME: This buffer should play nicer and be shrinkable/movable */ | 1409 | /* FIXME: This buffer should play nicer and be shrinkable/movable */ |
1410 | talk_buffer_set_policy(TALK_BUFFER_LOOSE); | 1410 | talk_buffer_set_policy(TALK_BUFFER_LOOSE); |
1411 | pcmrec_handle = core_alloc_maximum("pcmrec", &rec_buffer_size, &buflib_ops_locked); | 1411 | pcmrec_handle = core_alloc_maximum(&rec_buffer_size, &buflib_ops_locked); |
1412 | if (pcmrec_handle <= 0) | 1412 | if (pcmrec_handle <= 0) |
1413 | /* someone is abusing core_alloc_maximum(). Fix this evil guy instead of | 1413 | /* someone is abusing core_alloc_maximum(). Fix this evil guy instead of |
1414 | * trying to handle OOM without hope */ | 1414 | * trying to handle OOM without hope */ |
diff --git a/apps/shortcuts.c b/apps/shortcuts.c index 3f13d0c1b3..2e10bad00f 100644 --- a/apps/shortcuts.c +++ b/apps/shortcuts.c | |||
@@ -128,8 +128,7 @@ static struct shortcut* get_shortcut(int index) | |||
128 | 128 | ||
129 | if (first_handle == 0) | 129 | if (first_handle == 0) |
130 | { | 130 | { |
131 | first_handle = core_alloc_ex("shortcuts_head", | 131 | first_handle = core_alloc_ex(sizeof(struct shortcut_handle), &shortcut_ops); |
132 | sizeof(struct shortcut_handle), &shortcut_ops); | ||
133 | if (first_handle <= 0) | 132 | if (first_handle <= 0) |
134 | return NULL; | 133 | return NULL; |
135 | h = core_get_data(first_handle); | 134 | h = core_get_data(first_handle); |
@@ -146,11 +145,9 @@ static struct shortcut* get_shortcut(int index) | |||
146 | } while (handle_count > 0 && current_handle > 0); | 145 | } while (handle_count > 0 && current_handle > 0); |
147 | if (handle_count > 0 && handle_index == 0) | 146 | if (handle_count > 0 && handle_index == 0) |
148 | { | 147 | { |
149 | char buf[32]; | ||
150 | snprintf(buf, sizeof buf, "shortcuts_%d", index/SHORTCUTS_PER_HANDLE); | ||
151 | /* prevent invalidation of 'h' during compaction */ | 148 | /* prevent invalidation of 'h' during compaction */ |
152 | ++buflib_move_lock; | 149 | ++buflib_move_lock; |
153 | h->next_handle = core_alloc_ex(buf, sizeof(struct shortcut_handle), &shortcut_ops); | 150 | h->next_handle = core_alloc_ex(sizeof(struct shortcut_handle), &shortcut_ops); |
154 | --buflib_move_lock; | 151 | --buflib_move_lock; |
155 | if (h->next_handle <= 0) | 152 | if (h->next_handle <= 0) |
156 | return NULL; | 153 | return NULL; |
@@ -390,7 +387,7 @@ void shortcuts_init(void) | |||
390 | fd = open_utf8(SHORTCUTS_FILENAME, O_RDONLY); | 387 | fd = open_utf8(SHORTCUTS_FILENAME, O_RDONLY); |
391 | if (fd < 0) | 388 | if (fd < 0) |
392 | return; | 389 | return; |
393 | first_handle = core_alloc_ex("shortcuts_head", sizeof(struct shortcut_handle), &shortcut_ops); | 390 | first_handle = core_alloc_ex(sizeof(struct shortcut_handle), &shortcut_ops); |
394 | if (first_handle <= 0) { | 391 | if (first_handle <= 0) { |
395 | close(fd); | 392 | close(fd); |
396 | return; | 393 | return; |
diff --git a/apps/tagcache.c b/apps/tagcache.c index c853c9d5e8..69a6eaade5 100644 --- a/apps/tagcache.c +++ b/apps/tagcache.c | |||
@@ -410,7 +410,7 @@ static void allocate_tempbuf(void) | |||
410 | #else /* !__PCTOOL__ */ | 410 | #else /* !__PCTOOL__ */ |
411 | /* Need to pass dummy ops to prevent the buffer being moved | 411 | /* Need to pass dummy ops to prevent the buffer being moved |
412 | * out from under us, since we yield during the tagcache commit. */ | 412 | * out from under us, since we yield during the tagcache commit. */ |
413 | tempbuf_handle = core_alloc_maximum("tc tempbuf", &size, &buflib_ops_locked); | 413 | tempbuf_handle = core_alloc_maximum(&size, &buflib_ops_locked); |
414 | if (tempbuf_handle > 0) | 414 | if (tempbuf_handle > 0) |
415 | { | 415 | { |
416 | tempbuf = core_get_data(tempbuf_handle); | 416 | tempbuf = core_get_data(tempbuf_handle); |
@@ -4115,7 +4115,7 @@ static bool allocate_tagcache(void) | |||
4115 | alloc_size += tcmh.tch.entry_count*sizeof(struct dircache_fileref); | 4115 | alloc_size += tcmh.tch.entry_count*sizeof(struct dircache_fileref); |
4116 | #endif | 4116 | #endif |
4117 | 4117 | ||
4118 | int handle = core_alloc_ex("tc ramcache", alloc_size, &ops); | 4118 | int handle = core_alloc_ex(alloc_size, &ops); |
4119 | if (handle <= 0) | 4119 | if (handle <= 0) |
4120 | return false; | 4120 | return false; |
4121 | 4121 | ||
@@ -4158,7 +4158,7 @@ static bool tagcache_dumpload(void) | |||
4158 | } | 4158 | } |
4159 | 4159 | ||
4160 | /* Lets allocate real memory and load it */ | 4160 | /* Lets allocate real memory and load it */ |
4161 | handle = core_alloc_ex("tc ramcache", shdr.tc_stat.ramcache_allocated, &ops); | 4161 | handle = core_alloc_ex(shdr.tc_stat.ramcache_allocated, &ops); |
4162 | if (handle <= 0) | 4162 | if (handle <= 0) |
4163 | { | 4163 | { |
4164 | logf("alloc failure"); | 4164 | logf("alloc failure"); |
diff --git a/apps/tagtree.c b/apps/tagtree.c index 03af5fc83a..10e63ae210 100644 --- a/apps/tagtree.c +++ b/apps/tagtree.c | |||
@@ -1255,7 +1255,7 @@ static bool initialize_tagtree(void) /* also used when user selects 'Reload' in | |||
1255 | menu_count = 0; | 1255 | menu_count = 0; |
1256 | menu = NULL; | 1256 | menu = NULL; |
1257 | rootmenu = -1; | 1257 | rootmenu = -1; |
1258 | tagtree_handle = core_alloc_maximum("tagtree", &tagtree_bufsize, &ops); | 1258 | tagtree_handle = core_alloc_maximum(&tagtree_bufsize, &ops); |
1259 | if (tagtree_handle < 0) | 1259 | if (tagtree_handle < 0) |
1260 | panicf("tagtree OOM"); | 1260 | panicf("tagtree OOM"); |
1261 | 1261 | ||
diff --git a/apps/talk.c b/apps/talk.c index 65368e973f..2ef7fea84d 100644 --- a/apps/talk.c +++ b/apps/talk.c | |||
@@ -496,7 +496,7 @@ static bool load_index_table(int fd, const struct voicefile_header *hdr) | |||
496 | return true; | 496 | return true; |
497 | 497 | ||
498 | ssize_t alloc_size = (hdr->id1_max + hdr->id2_max) * sizeof(struct clip_entry); | 498 | ssize_t alloc_size = (hdr->id1_max + hdr->id2_max) * sizeof(struct clip_entry); |
499 | index_handle = core_alloc_ex("voice index", alloc_size, &talk_ops); | 499 | index_handle = core_alloc_ex(alloc_size, &talk_ops); |
500 | if (index_handle < 0) | 500 | if (index_handle < 0) |
501 | return false; | 501 | return false; |
502 | 502 | ||
@@ -536,7 +536,7 @@ static bool load_header(int fd, struct voicefile_header *hdr) | |||
536 | static bool create_clip_buffer(size_t max_size) | 536 | static bool create_clip_buffer(size_t max_size) |
537 | { | 537 | { |
538 | /* just allocate, populate on an as-needed basis later */ | 538 | /* just allocate, populate on an as-needed basis later */ |
539 | talk_handle = core_alloc_ex("voice data", max_size, &talk_ops); | 539 | talk_handle = core_alloc_ex(max_size, &talk_ops); |
540 | if (talk_handle < 0) | 540 | if (talk_handle < 0) |
541 | goto alloc_err; | 541 | goto alloc_err; |
542 | 542 | ||
diff --git a/apps/tree.c b/apps/tree.c index 22199710ae..d2a7111e5f 100644 --- a/apps/tree.c +++ b/apps/tree.c | |||
@@ -1063,14 +1063,11 @@ void tree_mem_init(void) | |||
1063 | 1063 | ||
1064 | cache->name_buffer_size = AVERAGE_FILENAME_LENGTH * | 1064 | cache->name_buffer_size = AVERAGE_FILENAME_LENGTH * |
1065 | global_settings.max_files_in_dir; | 1065 | global_settings.max_files_in_dir; |
1066 | cache->name_buffer_handle = core_alloc_ex("tree names", | 1066 | cache->name_buffer_handle = core_alloc_ex(cache->name_buffer_size, &ops); |
1067 | cache->name_buffer_size, | ||
1068 | &ops); | ||
1069 | 1067 | ||
1070 | cache->max_entries = global_settings.max_files_in_dir; | 1068 | cache->max_entries = global_settings.max_files_in_dir; |
1071 | cache->entries_handle = core_alloc_ex("tree entries", | 1069 | cache->entries_handle = |
1072 | cache->max_entries*(sizeof(struct entry)), | 1070 | core_alloc_ex(cache->max_entries*(sizeof(struct entry)), &ops); |
1073 | &ops); | ||
1074 | } | 1071 | } |
1075 | 1072 | ||
1076 | bool bookmark_play(char *resume_file, int index, unsigned long elapsed, | 1073 | bool bookmark_play(char *resume_file, int index, unsigned long elapsed, |
diff --git a/apps/voice_thread.c b/apps/voice_thread.c index 6ce0f6a408..dfc2dd8ed6 100644 --- a/apps/voice_thread.c +++ b/apps/voice_thread.c | |||
@@ -569,7 +569,7 @@ void voice_thread_init(void) | |||
569 | if (voice_thread_id != 0) | 569 | if (voice_thread_id != 0) |
570 | return; /* Already did an init and succeeded at it */ | 570 | return; /* Already did an init and succeeded at it */ |
571 | 571 | ||
572 | voice_buf_hid = core_alloc_ex("voice buf", sizeof (*voice_buf), &ops); | 572 | voice_buf_hid = core_alloc_ex(sizeof (*voice_buf), &ops); |
573 | 573 | ||
574 | if (voice_buf_hid <= 0) | 574 | if (voice_buf_hid <= 0) |
575 | { | 575 | { |