mirror of
https://github.com/apache/nuttx.git
synced 2026-05-28 03:45:50 +08:00
mm/mm_gran: fix data truncation by using size_t for mask
Use size_t instead of unsigned int for 'mask' to avoid address truncation, especially when memory addresses exceed 32 bits. Signed-off-by: liang.huang <liang.huang@houmo.ai>
This commit is contained in:
committed by
Matteo Golin
parent
e8b3630224
commit
64d191d32e
@@ -99,7 +99,7 @@ GRAN_HANDLE gran_initialize(FAR void *heapstart, size_t heapsize,
|
|||||||
FAR struct gran_s *priv;
|
FAR struct gran_s *priv;
|
||||||
uintptr_t heapend;
|
uintptr_t heapend;
|
||||||
uintptr_t alignedstart;
|
uintptr_t alignedstart;
|
||||||
unsigned int mask;
|
size_t mask;
|
||||||
unsigned int alignedsize;
|
unsigned int alignedsize;
|
||||||
unsigned int ngranules;
|
unsigned int ngranules;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user