DatasheetQ Logo
Electronic component search and free download site. Transistors,MosFET ,Diode,Integrated circuits

AN672 데이터 시트보기 (PDF) - Silicon Laboratories

부품명
상세내역
제조사
AN672
Silabs
Silicon Laboratories Silabs
AN672 Datasheet PDF : 30 Pages
1 2 3 4 5 6 7 8 9 10 Next Last
AN672
5.4. Memory Management
The si32Library supports static/compile time memory allocation, dynamic one-time allocation, and dynamic heap-
based allocation.
Static allocation relies on declaring all memory usage as data structures to be reserved and initialized by
the compiler when the system boots.
Dynamic one-time allocation relies on a statically allocated block of memory that is used to incrementally
satisfy allocation requests at runtime. Memory allocated in this manner is not recoverable via deallocation
or reallocation. It is only recoverable by resetting the entire memory block.
Dynamic heap-based allocation is essentially the malloc/free model supporting allocation, reallocation,
and deallocation on a heap.
Static allocation is performed by writing C code that declares and initializes data structures, and is outside the
scope of this discussion.
Dynamic one-time allocation is performed by overriding the default value of
si32BuildOption_incremental_zone_size, thus creating a block of memory for servicing allocations. Calls to
si32Base_allocate(SI32_INCREMENTAL_ZONE, size, alignment) claim memory from this block, called the
incremental zone. Attempts to free this memory via si32Base_deallocate(pointer) will succeed, but the memory
will not be reclaimed. Similarly, calls to si32Base_reallocate(pointer) will reallocate the pointer by claiming a new
block from the incremental zone, effectively leaking the previous allocation.
Dynamic heap allocation allows allocation, reallocation, and deallocation. si32Base_allocate(SI32_HEAP_ZONE,
size, alignment) behaves similarly to calloc(). si32Base_reallocate(pointer) behaves similarly to realloc() when
called on a heap pointer. si32Base_deallocate(pointer) behaves similarly to free() when called on a heap pointer.
Note: The performance of heap-based dynamic memory depends on the heap implementation provided by the tool chain.
Each supported compiler provides a unique implementation.
Rev. 0.1
7

Share Link: 

datasheetq.com  [ Privacy Policy ]Request Datasheet ] [ Contact Us ]