File tree Expand file tree Collapse file tree 3 files changed +8
-12
lines changed
Expand file tree Collapse file tree 3 files changed +8
-12
lines changed Original file line number Diff line number Diff line change 4141 * Pre-processor Definitions
4242 ****************************************************************************/
4343
44- #if CONFIG_MM_DEFAULT_ALIGNMENT == 0
45- # define MEMPOOL_ALIGN (2 * sizeof(uintptr_t))
46- #else
47- # define MEMPOOL_ALIGN CONFIG_MM_DEFAULT_ALIGNMENT
48- #endif
49-
5044#if CONFIG_MM_BACKTRACE >= 0
5145# define MEMPOOL_REALBLOCKSIZE (pool ) (ALIGN_UP((pool)->blocksize + \
5246 sizeof(struct mempool_backtrace_s), \
53- MEMPOOL_ALIGN ))
47+ MM_ALIGN ))
5448#else
5549# define MEMPOOL_REALBLOCKSIZE (pool ) ((pool)->blocksize)
5650#endif
Original file line number Diff line number Diff line change 156156# define MM_DUMP_LEAK (dump ,pid ) (false)
157157#endif
158158
159+ #if CONFIG_MM_DEFAULT_ALIGNMENT == 0
160+ # define MM_ALIGN (2 * sizeof(uintptr_t))
161+ #else
162+ # define MM_ALIGN CONFIG_MM_DEFAULT_ALIGNMENT
163+ #endif
164+
159165#define MM_INIT_MAGIC 0xcc
160166#define MM_ALLOC_MAGIC 0xaa
161167#define MM_FREE_MAGIC 0x55
Original file line number Diff line number Diff line change 3434#include <nuttx/fs/procfs.h>
3535#include <nuttx/lib/math32.h>
3636#include <nuttx/mm/mempool.h>
37+ #include <nuttx/mm/mm.h>
3738
3839#include <assert.h>
3940#include <sys/types.h>
114115#define MM_MAX_CHUNK (1 << MM_MAX_SHIFT)
115116#define MM_NNODES (MM_MAX_SHIFT - MM_MIN_SHIFT + 1)
116117
117- #if CONFIG_MM_DEFAULT_ALIGNMENT == 0
118- # define MM_ALIGN (2 * sizeof(uintptr_t))
119- #else
120- # define MM_ALIGN CONFIG_MM_DEFAULT_ALIGNMENT
121- #endif
122118#define MM_GRAN_MASK (MM_ALIGN - 1)
123119#define MM_ALIGN_UP (a ) (((a) + MM_GRAN_MASK) & ~MM_GRAN_MASK)
124120#define MM_ALIGN_DOWN (a ) ((a) & ~MM_GRAN_MASK)
You can’t perform that action at this time.
0 commit comments