#include "uffs/uffs_device.h"
Go to the source code of this file.
Data Structures | |
struct | _heap_mm_node |
struct | uffs_memAllocatorSt |
Defines | |
#define | GET_HASH_INDEX(p) ((((u32)(p)) >> 2) & HEAP_HASH_MASK) |
#define | HEAP_HASH_BIT 6 |
#define | HEAP_HASH_MASK (HEAP_HASH_SIZE - 1) |
#define | HEAP_HASH_SIZE (1 << (HEAP_HASH_BIT - 1)) |
Typedefs | |
typedef HEAP_MM * | HASHTBL |
typedef _heap_mm_node | HEAP_MM |
typedef uffs_memAllocatorSt | uffs_memAllocator |
Functions | |
void | uffs_InitHeapMemory (void *addr, int size) |
Add a new memory region to the free heap. | |
URET | uffs_initNativeMemAllocator (uffs_Device *dev) |
int | uffs_releaseNativeMemAllocator (uffs_Device *dev) |
#define GET_HASH_INDEX | ( | p | ) | ((((u32)(p)) >> 2) & HEAP_HASH_MASK) |
Definition at line 13 of file uffs_mem.h.
#define HEAP_HASH_BIT 6 |
Definition at line 10 of file uffs_mem.h.
#define HEAP_HASH_MASK (HEAP_HASH_SIZE - 1) |
Definition at line 12 of file uffs_mem.h.
#define HEAP_HASH_SIZE (1 << (HEAP_HASH_BIT - 1)) |
Definition at line 11 of file uffs_mem.h.
Definition at line 23 of file uffs_mem.h.
typedef struct _heap_mm_node HEAP_MM |
typedef struct uffs_memAllocatorSt uffs_memAllocator |
uffs native memory allocator
void uffs_InitHeapMemory | ( | void * | addr, | |
int | size | |||
) |
Add a new memory region to the free heap.
This function is called during initialization.
Applications typically do not call this function.
addr | Start address of the memory region. | |
size | Number of bytes of the memory region. |
Definition at line 483 of file uffs_mem.c.
References ALLOC_PAGE_SIZE, HEAP_NODE_ALLOCED, HEAP_NODE_FREE, NULL, uffs_CriticalEnter(), and uffs_CriticalExit().
Referenced by InitFileSystem().
URET uffs_initNativeMemAllocator | ( | uffs_Device * | dev | ) |
Definition at line 786 of file uffs_mem.c.
References uffs_memAllocatorSt::calloc, uffs_memAllocatorSt::free, uffs_memAllocatorSt::malloc, uffs_DeviceSt::mem, NULL, uffs_memAllocatorSt::realloc, uffs_memAllocatorSt::tbl, U_FAIL, and U_SUCC.
int uffs_releaseNativeMemAllocator | ( | uffs_Device * | dev | ) |
Definition at line 809 of file uffs_mem.c.
References uffs_DeviceSt::mem, and uffs_memAllocatorSt::tbl.