Rockbox open source high quality audio player as a Music Player Daemon
mpris rockbox mpd libadwaita audio rust zig deno
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

buflib: add comment in handle_alloc, remove a dead store

It isn't obvious why the "handle->val = -1" at the end of handle_alloc
is needed so add an explanatory comment. But "handle->val = 1" prior to
calling handle_free is simply a dead store.

Change-Id: I9ab4e96e87e940cfd1a2ed56f089287821669c73

+4 -1
+4 -1
firmware/buflib.c
··· 207 207 * and the found handle, therefore we can update first_free_handle */ 208 208 ctx->first_free_handle = handle - 1; 209 209 210 + /* We need to set the table entry to a non-NULL value to ensure that 211 + * compactions triggered by an allocation do not compact the handle 212 + * table and delete this handle. */ 210 213 handle->val = -1; 214 + 211 215 return handle; 212 216 } 213 217 ··· 613 617 { 614 618 goto buffer_alloc; 615 619 } else { 616 - handle->val=1; 617 620 handle_free(ctx, handle); 618 621 return -2; 619 622 }