uffs_mem.h File Reference

#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_MMHASHTBL
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 Documentation

#define GET_HASH_INDEX (  )     ((((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.


Typedef Documentation

typedef HEAP_MM* HASHTBL

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


Function Documentation

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.

Parameters:
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.


Generated on Sat Mar 17 15:45:45 2007 for uffs-doc by  doxygen 1.5.0