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>2019-04-10 02:07:44 +0300
committerChristopher Haster <chaster@utexas.edu>2019-04-10 19:27:48 +0300
commit1ff643229817ce1ec7bebd3bbf99f2dc4f2ab381 (patch)
tree14de32c0bfcc0e5be0aaefc98a483211ae3c2f33 /lfs_util.h
parentc2c2ce6b97d96ab1e13008392188e5a0360dd85a (diff)
Added clarification on buffer alignment.
In v2, the lookahead_buffer was changed from requiring 4-byte alignment to requiring 8-byte alignment. This was not documented as well as it could be, and as FabianInostroza noted, this also implies that lfs_malloc must provide 8-byte alignment. To protect against this, I've also added an assert on the alignment of both the lookahead_size and lookahead_buffer. found by FabianInostroza and amitv87
Diffstat (limited to 'lfs_util.h')
-rw-r--r--lfs_util.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/lfs_util.h b/lfs_util.h
index 1dc3b0f..28b1400 100644
--- a/lfs_util.h
+++ b/lfs_util.h
@@ -192,6 +192,7 @@ static inline uint32_t lfs_tobe32(uint32_t a) {
uint32_t lfs_crc(uint32_t crc, const void *buffer, size_t size);
// Allocate memory, only used if buffers are not provided to littlefs
+// Note, memory must be 64-bit aligned
static inline void *lfs_malloc(size_t size) {
#ifndef LFS_NO_MALLOC
return malloc(size);