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: update first_free_handle in handle_alloc

Since we're scanning the handle table for the first free slot,
we know none of the scanned slots are free. Use that knowledge
to update first_free_handle and avoid rescanning filled slots
again when the next handle is allocated.

Change-Id: I457372f66c231168cfffa7e905d1e9fb80002f5f

+9
+9
firmware/buflib.c
··· 196 196 if (handle >= ctx->alloc_end) 197 197 ctx->last_handle--; 198 198 else 199 + { 200 + /* We know the table is full, so update first_free_handle */ 201 + ctx->first_free_handle = ctx->last_handle - 1; 199 202 return NULL; 203 + } 200 204 } 205 + 206 + /* We know there are no free handles between the old first_free_handle 207 + * and the found handle, therefore we can update first_free_handle */ 208 + ctx->first_free_handle = handle - 1; 209 + 201 210 handle->val = -1; 202 211 return handle; 203 212 }