lwip-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-devel] [bug #63322] Allow custom (non-libc) malloc implementations


From: Faidon Liambotis
Subject: [lwip-devel] [bug #63322] Allow custom (non-libc) malloc implementations to be provided
Date: Sun, 6 Nov 2022 11:57:57 -0500 (EST)

URL:
  <https://savannah.nongnu.org/bugs/?63322>

                 Summary: Allow custom (non-libc) malloc implementations to be
provided
                 Project: lwIP - A Lightweight TCP/IP stack
               Submitter: paravoid
               Submitted: Sun 06 Nov 2022 04:57:55 PM UTC
                Category: Platform ports
                Severity: 3 - Normal
              Item Group: Feature Request
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: None
            lwIP version: git head


    _______________________________________________________

Follow-up Comments:


-------------------------------------------------------
Date: Sun 06 Nov 2022 04:57:55 PM UTC By: Faidon Liambotis <paravoid>
In 2006 (commit a91374a9) MEM_LIBC_MALLOC was introduced, to allow one to use
the libc's implementation of malloc/calloc/free.

Unfortunately this does not allow one to plug a different, non-lwip, non-libc
implementation. The code is not far from there: setting MEM_LIBC_MALLOC=1 and
#defining mem_clib_free, mem_clib_malloc and mem_clib_calloc is enough to work
around this. A spurious #include of <stdlib.h> happens in that case, though.

Instead of this workaround, we can generalize this into 
MEM_CUSTOM_MALLOC/_CALLOC/_FREE definitions, and make MEM_LIBC_MALLOC a
specialized case of it.

I gave it a stab with the patch attached. Let me know what you think and
please feel free to modify as necessary!






    _______________________________________________________
File Attachments:


-------------------------------------------------------
Date: Sun 06 Nov 2022 04:57:55 PM UTC  Name:
0001-Add-MEM_CUSTOM_ALLOCATOR-and-make-LIBC-a-subset-of-i.patch  Size: 6KiB  
By: paravoid

<http://savannah.nongnu.org/bugs/download.php?file_id=53935>

    _______________________________________________________

Reply to this item at:

  <https://savannah.nongnu.org/bugs/?63322>

_______________________________________________
Message sent via Savannah
https://savannah.nongnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]