<?xml version='1.0' encoding='UTF-8' standalone='no'?> <doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version="1.8.16"> <compounddef id="group__lwip__opts__mem" kind="group"> <compoundname>lwip_opts_mem</compoundname> <title>Heap and memory pools</title> <sectiondef kind="define"> <memberdef kind="define" id="group__lwip__opts__mem_1ga0a3ef6098813c103e5aba07da76e15e2" prot="public" static="no"> <name>LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT</name> <initializer>0</initializer> <briefdescription> </briefdescription> <detaileddescription> <para>Set this to 1 if you want to free PBUF_RAM pbufs (or call <ref refid="mem_8h_1a2fd7aa1adf6e394d3be7c7734e7df41a" kindref="member">mem_free()</ref>) from interrupt context (or another context that doesn't allow waiting for a semaphore). If set to 1, mem_malloc will be protected by a semaphore and SYS_ARCH_PROTECT, while mem_free will only use SYS_ARCH_PROTECT. mem_malloc SYS_ARCH_UNPROTECTs with each loop so that mem_free can run.</para> <para>ATTENTION: As you can see from the above description, this leads to dis-/ enabling interrupts often, which can be slow! Also, on low memory, mem_malloc can need longer.</para> <para>If you don't want that, at least for NO_SYS=0, you can still use the following functions to enqueue a deallocation call which then runs in the tcpip_thread context:<itemizedlist> <listitem><para>pbuf_free_callback(p);</para> </listitem><listitem><para>mem_free_callback(m); </para> </listitem></itemizedlist> </para> </detaileddescription> <inbodydescription> </inbodydescription> <location file="C:/Dev/git/UbixOS/sys/include/net/opt.h" line="287" column="9" bodyfile="C:/Dev/git/UbixOS/sys/include/net/opt.h" bodystart="287" bodyend="-1"/> </memberdef> <memberdef kind="define" id="group__lwip__opts__mem_1ga97343214666ee6dcb18c0bd77b441ea7" prot="public" static="no"> <name>MEM_ALIGNMENT</name> <initializer>1</initializer> <briefdescription> </briefdescription> <detaileddescription> <para>MEM_ALIGNMENT: should be set to the alignment of the CPU 4 byte alignment -> #define MEM_ALIGNMENT 4 2 byte alignment -> #define MEM_ALIGNMENT 2 </para> </detaileddescription> <inbodydescription> </inbodydescription> <location file="C:/Dev/git/UbixOS/sys/include/net/opt.h" line="208" column="9" bodyfile="C:/Dev/git/UbixOS/sys/include/net/opt.h" bodystart="208" bodyend="-1"/> </memberdef> <memberdef kind="define" id="group__lwip__opts__mem_1ga4ef345cc270912bd2230b1c5ec51dfc8" prot="public" static="no"> <name>MEM_LIBC_MALLOC</name> <initializer>0</initializer> <briefdescription> </briefdescription> <detaileddescription> <para>MEM_LIBC_MALLOC==1: Use malloc/free/realloc provided by your C-library instead of the lwip internal allocator. Can save code size if you already use it. </para> </detaileddescription> <inbodydescription> </inbodydescription> <location file="C:/Dev/git/UbixOS/sys/include/net/opt.h" line="186" column="9" bodyfile="C:/Dev/git/UbixOS/sys/include/net/opt.h" bodystart="186" bodyend="-1"/> </memberdef> <memberdef kind="define" id="group__lwip__opts__mem_1ga2dcf8c45f945dd0c4301a94700f2112c" prot="public" static="no"> <name>MEM_SIZE</name> <initializer>1600</initializer> <briefdescription> </briefdescription> <detaileddescription> <para>MEM_SIZE: the size of the heap memory. If the application will send a lot of data that needs to be copied, this should be set high. </para> </detaileddescription> <inbodydescription> </inbodydescription> <location file="C:/Dev/git/UbixOS/sys/include/net/opt.h" line="216" column="9" bodyfile="C:/Dev/git/UbixOS/sys/include/net/opt.h" bodystart="216" bodyend="-1"/> </memberdef> <memberdef kind="define" id="group__lwip__opts__mem_1gaddca3141bc7037241769eb152b6f89ba" prot="public" static="no"> <name>MEM_USE_POOLS</name> <initializer>0</initializer> <briefdescription> </briefdescription> <detaileddescription> <para>MEM_USE_POOLS==1: Use an alternative to malloc() by allocating from a set of memory pools of various sizes. When mem_malloc is called, an element of the smallest pool that can provide the length needed is returned. To use this, MEMP_USE_CUSTOM_POOLS also has to be enabled. </para> </detaileddescription> <inbodydescription> </inbodydescription> <location file="C:/Dev/git/UbixOS/sys/include/net/opt.h" line="247" column="9" bodyfile="C:/Dev/git/UbixOS/sys/include/net/opt.h" bodystart="247" bodyend="-1"/> </memberdef> <memberdef kind="define" id="group__lwip__opts__mem_1gaba8be68e8fd0716b723ce4569ed89f82" prot="public" static="no"> <name>MEM_USE_POOLS_TRY_BIGGER_POOL</name> <initializer>0</initializer> <briefdescription> </briefdescription> <detaileddescription> <para>MEM_USE_POOLS_TRY_BIGGER_POOL==1: if one malloc-pool is empty, try the next bigger pool - WARNING: THIS MIGHT WASTE MEMORY but it can make a system more reliable. </para> </detaileddescription> <inbodydescription> </inbodydescription> <location file="C:/Dev/git/UbixOS/sys/include/net/opt.h" line="255" column="9" bodyfile="C:/Dev/git/UbixOS/sys/include/net/opt.h" bodystart="255" bodyend="-1"/> </memberdef> <memberdef kind="define" id="group__lwip__opts__mem_1gae93af697d27bbcefa6a28052d90f2f38" prot="public" static="no"> <name>MEMP_MEM_MALLOC</name> <initializer>0</initializer> <briefdescription> </briefdescription> <detaileddescription> <para>MEMP_MEM_MALLOC==1: Use mem_malloc/mem_free instead of the lwip pool allocator. Especially useful with MEM_LIBC_MALLOC but handle with care regarding execution speed (heap alloc can be much slower than pool alloc) and usage from interrupts (especially if your netif driver allocates PBUF_POOL pbufs for received frames from interrupt)! ATTENTION: Currently, this uses the heap for ALL pools (also for private pools, not only for internal pools defined in <ref refid="memp__std_8h" kindref="compound">memp_std.h</ref>)! </para> </detaileddescription> <inbodydescription> </inbodydescription> <location file="C:/Dev/git/UbixOS/sys/include/net/opt.h" line="199" column="9" bodyfile="C:/Dev/git/UbixOS/sys/include/net/opt.h" bodystart="199" bodyend="-1"/> </memberdef> <memberdef kind="define" id="group__lwip__opts__mem_1ga27fdd01194a42fc41a7716b72cdb49e3" prot="public" static="no"> <name>MEMP_OVERFLOW_CHECK</name> <initializer>0</initializer> <briefdescription> </briefdescription> <detaileddescription> <para>MEMP_OVERFLOW_CHECK: memp overflow protection reserves a configurable amount of bytes before and after each memp element in every pool and fills it with a prominent default value. MEMP_OVERFLOW_CHECK == 0 no checking MEMP_OVERFLOW_CHECK == 1 checks each element when it is freed MEMP_OVERFLOW_CHECK >= 2 checks each element in every pool every time <ref refid="memp_8h_1a2b00593d086313c267b54a976bf67aa5" kindref="member">memp_malloc()</ref> or <ref refid="memp_8h_1aecd94926b7c2a0e23ae195f4ae97581f" kindref="member">memp_free()</ref> is called (useful but slow!) </para> </detaileddescription> <inbodydescription> </inbodydescription> <location file="C:/Dev/git/UbixOS/sys/include/net/opt.h" line="229" column="9" bodyfile="C:/Dev/git/UbixOS/sys/include/net/opt.h" bodystart="229" bodyend="-1"/> </memberdef> <memberdef kind="define" id="group__lwip__opts__mem_1ga0838947193e222a9f46b582e01e5beff" prot="public" static="no"> <name>MEMP_SANITY_CHECK</name> <initializer>0</initializer> <briefdescription> </briefdescription> <detaileddescription> <para>MEMP_SANITY_CHECK==1: run a sanity check after each <ref refid="memp_8h_1aecd94926b7c2a0e23ae195f4ae97581f" kindref="member">memp_free()</ref> to make sure that there are no cycles in the linked lists. </para> </detaileddescription> <inbodydescription> </inbodydescription> <location file="C:/Dev/git/UbixOS/sys/include/net/opt.h" line="237" column="9" bodyfile="C:/Dev/git/UbixOS/sys/include/net/opt.h" bodystart="237" bodyend="-1"/> </memberdef> <memberdef kind="define" id="group__lwip__opts__mem_1ga69de593b8ffd4f1c249f03e48e11983b" prot="public" static="no"> <name>MEMP_USE_CUSTOM_POOLS</name> <initializer>0</initializer> <briefdescription> </briefdescription> <detaileddescription> <para>MEMP_USE_CUSTOM_POOLS==1: whether to include a user file lwippools.h that defines additional pools beyond the "standard" ones required by lwIP. If you set this to 1, you must have lwippools.h in your include path somewhere. </para> </detaileddescription> <inbodydescription> </inbodydescription> <location file="C:/Dev/git/UbixOS/sys/include/net/opt.h" line="265" column="9" bodyfile="C:/Dev/git/UbixOS/sys/include/net/opt.h" bodystart="265" bodyend="-1"/> </memberdef> </sectiondef> <briefdescription> </briefdescription> <detaileddescription> </detaileddescription> </compounddef> </doxygen>