summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/filetypes.c2
-rw-r--r--apps/tagtree.c2
-rw-r--r--firmware/buflib.c2
-rw-r--r--firmware/chunk_alloc.c4
-rw-r--r--firmware/linuxboot.c2
5 files changed, 5 insertions, 7 deletions
diff --git a/apps/filetypes.c b/apps/filetypes.c
index d5cfc379c1..1944ee9383 100644
--- a/apps/filetypes.c
+++ b/apps/filetypes.c
@@ -414,7 +414,7 @@ static void read_viewers_config_init(void)
414 goto out; 414 goto out;
415 415
416 read_config_init(fd); 416 read_config_init(fd);
417 core_shrink(strdup_handle, core_get_data(strdup_handle), strdup_cur_idx); 417 core_shrink(strdup_handle, NULL, strdup_cur_idx);
418 418
419 out: 419 out:
420 close(fd); 420 close(fd);
diff --git a/apps/tagtree.c b/apps/tagtree.c
index 10e63ae210..11ea8ecf4e 100644
--- a/apps/tagtree.c
+++ b/apps/tagtree.c
@@ -1285,7 +1285,7 @@ static bool initialize_tagtree(void) /* also used when user selects 'Reload' in
1285 add_event(PLAYBACK_EVENT_TRACK_BUFFER, tagtree_buffer_event); 1285 add_event(PLAYBACK_EVENT_TRACK_BUFFER, tagtree_buffer_event);
1286 add_event(PLAYBACK_EVENT_TRACK_FINISH, tagtree_track_finish_event); 1286 add_event(PLAYBACK_EVENT_TRACK_FINISH, tagtree_track_finish_event);
1287 1287
1288 core_shrink(tagtree_handle, core_get_data(tagtree_handle), tagtree_buf_used); 1288 core_shrink(tagtree_handle, NULL, tagtree_buf_used);
1289 return true; 1289 return true;
1290} 1290}
1291 1291
diff --git a/firmware/buflib.c b/firmware/buflib.c
index 0f8836b3b7..cb35290c03 100644
--- a/firmware/buflib.c
+++ b/firmware/buflib.c
@@ -894,7 +894,7 @@ bool
894buflib_shrink(struct buflib_context* ctx, int handle, void* new_start, size_t new_size) 894buflib_shrink(struct buflib_context* ctx, int handle, void* new_start, size_t new_size)
895{ 895{
896 char* oldstart = buflib_get_data(ctx, handle); 896 char* oldstart = buflib_get_data(ctx, handle);
897 char* newstart = new_start; 897 char* newstart = new_start != NULL ? new_start : oldstart;
898 char* newend = newstart + new_size; 898 char* newend = newstart + new_size;
899 899
900 /* newstart must be higher and new_size not "negative" */ 900 /* newstart must be higher and new_size not "negative" */
diff --git a/firmware/chunk_alloc.c b/firmware/chunk_alloc.c
index 6b80a475ab..85ad5d3489 100644
--- a/firmware/chunk_alloc.c
+++ b/firmware/chunk_alloc.c
@@ -172,12 +172,10 @@ static void finalize(struct chunk_alloc_header *hdr, struct chunk *chunk_array)
172 int handle = chunk_array[idx].handle; 172 int handle = chunk_array[idx].handle;
173 struct buflib_context *ctx = hdr->context; 173 struct buflib_context *ctx = hdr->context;
174 174
175 void* chunk_start = buflib_get_data(ctx, handle);
176
177 hdr->chunk_bytes_total -= hdr->chunk_bytes_free; 175 hdr->chunk_bytes_total -= hdr->chunk_bytes_free;
178 hdr->chunk_bytes_free = 0; 176 hdr->chunk_bytes_free = 0;
179 177
180 buflib_shrink(ctx, handle, chunk_start, hdr->chunk_bytes_total); 178 buflib_shrink(ctx, handle, NULL, hdr->chunk_bytes_total);
181 179
182 logf("%s shrink hdr idx[%ld] offset[%ld]: new size: %ld", 180 logf("%s shrink hdr idx[%ld] offset[%ld]: new size: %ld",
183 __func__, idx, chunk_array[idx].max_start_offset, hdr->chunk_bytes_total); 181 __func__, idx, chunk_array[idx].max_start_offset, hdr->chunk_bytes_total);
diff --git a/firmware/linuxboot.c b/firmware/linuxboot.c
index 74d87fbd64..6803bb466b 100644
--- a/firmware/linuxboot.c
+++ b/firmware/linuxboot.c
@@ -217,7 +217,7 @@ int uimage_load(struct uimage_header* uh, size_t* out_size,
217 if(ret) 217 if(ret)
218 goto err; 218 goto err;
219 219
220 core_shrink(out_h, core_get_data(out_h), *out_size); 220 core_shrink(out_h, NULL, *out_size);
221 ret = 0; 221 ret = 0;
222 222
223 err: 223 err: