Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/littlefs-project/littlefs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Haster <chaster@utexas.edu>2018-10-23 01:58:47 +0300
committerChristopher Haster <chaster@utexas.edu>2018-10-23 01:58:47 +0300
commitdc507a7b5f73278604d1b11921acbec8f58d358a (patch)
tree68bddc81820995e91e3fe67e5582f261630b4154
parent5b26c68ae2abae93b0fea4fca669765841dd1d2a (diff)
Changed required alignment of lookahead_size to 64 bits
This is to prepare for future compatibility with other implementations of the allocator's lookahead that are under consideration. The most promising design so far is a sort of segments-list data structure that stores pointer+size pairs, requiring 64-bits of alignment. Changing this now takes advantage of the major version to avoid a compatibility break in the future. If we end up not changing the allocator or don't need 64-bit alignment we can easily drop this requirement without breaking anyone's code.
-rw-r--r--lfs.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lfs.c b/lfs.c
index 4c914ee..31297c1 100644
--- a/lfs.c
+++ b/lfs.c
@@ -3095,8 +3095,8 @@ static int lfs_init(lfs_t *lfs, const struct lfs_config *cfg) {
lfs_cache_zero(lfs, &lfs->rcache);
lfs_cache_zero(lfs, &lfs->pcache);
- // setup lookahead, must be multiple of 32-bits
- LFS_ASSERT(lfs->cfg->lookahead_size % 4 == 0);
+ // setup lookahead, must be multiple of 64-bits
+ LFS_ASSERT(lfs->cfg->lookahead_size % 8 == 0);
LFS_ASSERT(lfs->cfg->lookahead_size > 0);
if (lfs->cfg->lookahead_buffer) {
lfs->free.buffer = lfs->cfg->lookahead_buffer;