1 Dec 08:02
kugel: r31101 - trunk/firmware
<mailer <at> svn.rockbox.org>
2011-12-01 07:02:18 GMT
2011-12-01 07:02:18 GMT
Date: 2011-12-01 08:02:18 +0100 (Thu, 01 Dec 2011)
New Revision: 31101
Log Message:
Address some weaknesses and bugs of buflib_compact() and make the code prettier. Thanks to Boris Gjenero
for his great investigation.
Flyspray: FS#12409
Author: myself
Modified:
trunk/firmware/buflib.c
Modified: trunk/firmware/buflib.c
===================================================================
--- trunk/firmware/buflib.c 2011-11-30 18:47:31 UTC (rev 31100)
+++ trunk/firmware/buflib.c 2011-12-01 07:02:18 UTC (rev 31101)
@@ -237,12 +237,25 @@
{
BDEBUGF("%s(): Compacting!\n", __func__);
union buflib_data *block,
- *first_free = find_first_free(ctx);
+ *hole = NULL;
int shift = 0, len;
/* Store the results of attempting to shrink the handle table */
bool ret = handle_table_shrink(ctx);
- for(block = first_free; block < ctx->alloc_end; block += len)
+ /* compaction has basically two modes of operation:
+ * 1) the buffer is nicely movable: In this mode, blocks can be simply
+ * moved towards the beginning. Free blocks add to a shift value,
(Continue reading)
RSS Feed