mirror of
https://github.com/littlefs-project/littlefs.git
synced 2025-10-14 02:43:30 +08:00
perf: gc might try to populate the lookahead buffer each time
This commit is contained in:
2
lfs.c
2
lfs.c
@@ -5225,7 +5225,7 @@ static int lfs_fs_gc_(lfs_t *lfs) {
|
||||
}
|
||||
|
||||
// try to populate the lookahead buffer, unless it's already full
|
||||
if (lfs->lookahead.size < 8*lfs->cfg->lookahead_size) {
|
||||
if (lfs->lookahead.size < lfs_min(8 * lfs->cfg->lookahead_size, lfs->block_count)) {
|
||||
err = lfs_alloc_scan(lfs);
|
||||
if (err) {
|
||||
return err;
|
||||
|
Reference in New Issue
Block a user