# Porting<a name="EN-US_TOPIC_0000001215769367"></a>## How Do I Mount the Heap Memory to the Kernel?<a name="section21471536184914"></a>- The following table describes the macros for configuring the kernel heap memory. You can configure them as required in the **target\_config.h** file.**Table 1** Macros for configuring the kernel heap memory<aname="en-us_topic_0000001153683024_table04172020563"></a><table><theadalign="left"><trid="en-us_topic_0000001153683024_row5462035616"><thclass="cellrowborder"valign="top"width="39.12%"id="mcps1.2.3.1.1"><pid="en-us_topic_0000001153683024_p1456204569"><aname="en-us_topic_0000001153683024_p1456204569"></a><aname="en-us_topic_0000001153683024_p1456204569"></a>Macro</p></th><thclass="cellrowborder"valign="top"width="60.88%"id="mcps1.2.3.1.2"><pid="en-us_topic_0000001153683024_p19502005618"><aname="en-us_topic_0000001153683024_p19502005618"></a><aname="en-us_topic_0000001153683024_p19502005618"></a>Description</p></th></tr></thead><tbody><trid="en-us_topic_0000001153683024_row14522018560"><tdclass="cellrowborder"valign="top"width="39.12%"headers="mcps1.2.3.1.1 "><pid="en-us_topic_0000001153683024_p35112025620"><aname="en-us_topic_0000001153683024_p35112025620"></a><aname="en-us_topic_0000001153683024_p35112025620"></a>LOSCFG_SYS_EXTERNAL_HEAP</p></td><tdclass="cellrowborder"valign="top"width="60.88%"headers="mcps1.2.3.1.2 "><pid="en-us_topic_0000001153683024_p5127138175710"><aname="en-us_topic_0000001153683024_p5127138175710"></a><aname="en-us_topic_0000001153683024_p5127138175710"></a>Specifies whether the internal kernel heap memory or the user heap memory will be used. The default value is <strongid="en-us_topic_0000001153683024_b161891157141719"><aname="en-us_topic_0000001153683024_b161891157141719"></a><aname="en-us_topic_0000001153683024_b161891157141719"></a>0</strong> and indicates that the internal heap memory whose size is <strongid="en-us_topic_0000001153683024_b116218121820"><aname="en-us_topic_0000001153683024_b116218121820"></a><aname="en-us_topic_0000001153683024_b116218121820"></a>0x10000</strong> will be used. If you want to use the external heap memory, set this macro to <strongid="en-us_topic_0000001153683024_b2744657141814"><aname="en-us_topic_0000001153683024_b2744657141814"></a><aname="en-us_topic_0000001153683024_b2744657141814"></a>1</strong>.</p></td></tr><trid="en-us_topic_0000001153683024_row20514209567"><tdclass="cellrowborder"valign="top"width="39.12%"headers="mcps1.2.3.1.1 "><pid="en-us_topic_0000001153683024_p5532017563"><aname="en-us_topic_0000001153683024_p5532017563"></a><aname="en-us_topic_0000001153683024_p5532017563"></a>LOSCFG_SYS_HEAP_ADDR</p></td><tdclass="cellrowborder"valign="top"width="60.88%"headers="mcps1.2.3.1.2 "><pid="en-us_topic_0000001153683024_p65520125619"><aname="en-us_topic_0000001153683024_p65520125619"></a><aname="en-us_topic_0000001153683024_p65520125619"></a>Specifies the start address of the kernel heap memory.</p></td></tr><trid="en-us_topic_0000001153683024_row15302929115615"><tdclass="cellrowborder"valign="top"width="39.12%"headers="mcps1.2.3.1.1 "><pid="en-us_topic_0000001153683024_p113021529145612"><aname="en-us_topic_0000001153683024_p113021529145612"></a><aname="en-us_topic_0000001153683024_p113021529145612"></a>LOSCFG_SYS_HEAP_SIZE</p></td><tdclass="cellrowborder"valign="top"width="60.88%"headers="mcps1.2.3.1.2 "><pid="en-us_topic_0000001153683024_p1030252965619"><aname="en-us_topic_0000001153683024_p1030252965619"></a><aname="en-us_topic_0000001153683024_p1030252965619"></a>Specifies the size of the kernel heap memory, that is, size of the memory block specified by <strongid="en-us_topic_0000001153683024_b1611815991419"><aname="en-us_topic_0000001153683024_b1611815991419"></a><aname="en-us_topic_0000001153683024_b1611815991419"></a>LOSCFG_SYS_HEAP_ADDR</strong>.</p></td></tr></tbody></table>- Note:Ensure that the specified heap memory range is not used by other modules. Otherwise, functions of the heap memory will be damaged due to the heap memory corruption.