Myseg Heap Initial Memory Map - Texas Instruments TMS320C55 Series Reference Manual

Dsp/bios 5.32 application programming interface api
Table of Contents

Advertisement

When using the large memory model, the MEM module divides heaps
that cross page boundaries into memory blocks that do not cross
boundaries. As a result, MEM_alloc and MEM_free can only allocate and
free memory within a single memory block, and the largest block that
MEM_alloc can allocate in any case is 64K words (0x10000).
For example, suppose you create a RAM segment called MYRAM that is
100K words in length. MYRAM has a base address of 2:F000 and a
length of 0x19000. The heap within MYRAM is also 100K words and has
a heap identifier label of MYSEG. So this heap also has a base address
of 2:F000 and ends at 4:7FFF.
To prevent a memory block from crossing a page boundary, the MEM
Module separates this heap into the following memory blocks, which are
aligned along 64K page boundaries:
Figure 2-1. MYSEG Heap Initial Memory Map
2:F000
2:FFFF
3:0000
3:FFFF
4:0000
4:7FFF
Suppose your program calls MEM_alloc in the following sequence:
P3 = MEM_alloc(MYSEG, 0xFF80, 0);
P1 = MEM_alloc(MYSEG, 0x6000, 0);
P2 = MEM_alloc(MYSEG, 0x1800, 0);
P4 = MEM_alloc(MYSEG, 0x800, 0);
Block 1
Length 0x1000 (4K words)
Block 2
Length 0x10000 (64K words)
Block 3
Length 0x8000 (32K words)
Application Program Interface
MEM_alloc
2-215

Advertisement

Table of Contents
loading

Table of Contents