diff --git a/lfs3.c b/lfs3.c index 4953da72..54a2e9d6 100644 --- a/lfs3.c +++ b/lfs3.c @@ -15449,18 +15449,19 @@ static int lfs3_init(lfs3_t *lfs3, uint32_t flags, lfs3_alloc_discard(lfs3); #endif - // setup treediff buffer - #if !defined(LFS3_RDONLY) && !defined(LFS3_2BONLY) && defined(LFS3_BMAP) - if (lfs3->cfg->treediff_buffer) { - lfs3->treediff.buffer = lfs3->cfg->treediff_buffer; - } else { - lfs3->treediff.buffer = lfs3_malloc(lfs3->cfg->treediff_size); - if (!lfs3->treediff.buffer) { - err = LFS3_ERR_NOMEM; - goto failed; - } - } - #endif +// TODO rm me +// // setup treediff buffer +// #if !defined(LFS3_RDONLY) && !defined(LFS3_2BONLY) && defined(LFS3_BMAP) +// if (lfs3->cfg->treediff_buffer) { +// lfs3->treediff.buffer = lfs3->cfg->treediff_buffer; +// } else { +// lfs3->treediff.buffer = lfs3_malloc(lfs3->cfg->treediff_size); +// if (!lfs3->treediff.buffer) { +// err = LFS3_ERR_NOMEM; +// goto failed; +// } +// } +// #endif // check that the size limits are sane #ifndef LFS3_RDONLY @@ -15649,11 +15650,12 @@ static int lfs3_deinit(lfs3_t *lfs3) { } #endif - #if !defined(LFS3_RDONLY) && !defined(LFS3_2BONLY) && defined(LFS3_BMAP) - if (!lfs3->cfg->treediff_buffer) { - lfs3_free(lfs3->treediff.buffer); - } - #endif +// TODO rm me +// #if !defined(LFS3_RDONLY) && !defined(LFS3_2BONLY) && defined(LFS3_BMAP) +// if (!lfs3->cfg->treediff_buffer) { +// lfs3_free(lfs3->treediff.buffer); +// } +// #endif return 0; } diff --git a/lfs3.h b/lfs3.h index 5ba8ae17..2ba8e7fa 100644 --- a/lfs3.h +++ b/lfs3.h @@ -465,12 +465,13 @@ struct lfs3_cfg { lfs3_size_t lookahead_size; #endif - // Size of the treediff buffer in bytes. A larger treediff buffer speeds - // up tree diffing in BMAPSLOW and BMAPFAST modes. The treediff buffer - // also uses a compact bitmap, and sizes >block_count/8 have no effect. - #if !defined(LFS3_RDONLY) && defined(LFS3_BMAP) - lfs3_size_t treediff_size; - #endif +// TODO rm me +// // Size of the treediff buffer in bytes. A larger treediff buffer speeds +// // up tree diffing in BMAPSLOW and BMAPFAST modes. The treediff buffer +// // also uses a compact bitmap, and sizes >block_count/8 have no effect. +// #if !defined(LFS3_RDONLY) && defined(LFS3_BMAP) +// lfs3_size_t treediff_size; +// #endif // Flags indicating what gc work to do during lfs3_gc calls. #ifdef LFS3_GC @@ -520,11 +521,12 @@ struct lfs3_cfg { void *lookahead_buffer; #endif - // Optional statically allocated treediff buffer. Must be treediff_size. - // By default lfs3_malloc is used to allocate this buffer. - #if !defined(LFS3_RDONLY) && defined(LFS3_BMAP) - void *treediff_buffer; - #endif +// TODO rm me +// // Optional statically allocated treediff buffer. Must be treediff_size. +// // By default lfs3_malloc is used to allocate this buffer. +// #if !defined(LFS3_RDONLY) && defined(LFS3_BMAP) +// void *treediff_buffer; +// #endif // Optional upper limit on length of file names in bytes. No downside for // larger names except the size of the info struct which is controlled by @@ -937,11 +939,12 @@ typedef struct lfs3 { } lookahead; #endif - #if !defined(LFS3_RDONLY) && !defined(LFS3_2BONLY) && defined(LFS3_BMAP) - struct lfs3_treediff { - uint8_t *buffer; - } treediff; - #endif +// TODO rm me +// #if !defined(LFS3_RDONLY) && !defined(LFS3_2BONLY) && defined(LFS3_BMAP) +// struct lfs3_treediff { +// uint8_t *buffer; +// } treediff; +// #endif #if !defined(LFS3_RDONLY) && !defined(LFS3_2BONLY) const lfs3_data_t *graft; diff --git a/runners/bench_runner.h b/runners/bench_runner.h index d4ed572e..51c5bd3a 100644 --- a/runners/bench_runner.h +++ b/runners/bench_runner.h @@ -114,7 +114,6 @@ void bench_permutation(size_t i, uint32_t *buffer, size_t size); BENCH_DEFINE(PCACHE_SIZE, LFS3_MAX(16, PROG_SIZE) ) \ BENCH_DEFINE(FILE_CACHE_SIZE, 16 ) \ BENCH_DEFINE(LOOKAHEAD_SIZE, 16 ) \ - BENCH_DEFINE(TREEDIFF_SIZE, 16 ) \ BENCH_DEFINE(GC_FLAGS, 0 ) \ BENCH_DEFINE(GC_STEPS, 0 ) \ BENCH_DEFINE(GC_COMPACT_THRESH, 0 ) \ @@ -155,7 +154,6 @@ void bench_permutation(size_t i, uint32_t *buffer, size_t size); #ifdef LFS3_BMAP #define BENCH_BMAP_CFG \ - .treediff_size = TREEDIFF_SIZE, \ .bmap_scan_thresh = BMAP_SCAN_THRESH, #else #define BENCH_BMAP_CFG diff --git a/runners/test_runner.h b/runners/test_runner.h index d22ead69..bb88de48 100644 --- a/runners/test_runner.h +++ b/runners/test_runner.h @@ -105,7 +105,6 @@ void test_permutation(size_t i, uint32_t *buffer, size_t size); TEST_DEFINE(PCACHE_SIZE, LFS3_MAX(16, PROG_SIZE) ) \ TEST_DEFINE(FILE_CACHE_SIZE, 16 ) \ TEST_DEFINE(LOOKAHEAD_SIZE, 16 ) \ - TEST_DEFINE(TREEDIFF_SIZE, 16 ) \ TEST_DEFINE(GC_FLAGS, 0 ) \ TEST_DEFINE(GC_STEPS, 0 ) \ TEST_DEFINE(GC_COMPACT_THRESH, 0 ) \ @@ -146,7 +145,6 @@ void test_permutation(size_t i, uint32_t *buffer, size_t size); #ifdef LFS3_BMAP #define TEST_BMAP_CFG \ - .treediff_size = TREEDIFF_SIZE, \ .bmap_scan_thresh = BMAP_SCAN_THRESH, #else #define TEST_BMAP_CFG