lwIP - A Lightweight TCP/IP stack - Bugs: bug #63322, Allow custom (non-libc) malloc...
You are not allowed to post comments on this tracker with your current authentication level.
bug #63322: Allow custom (non-libc) malloc implementations to be provided
Submitter: | Faidon Liambotis <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 | Planned Release: | None |
lwIP version: | git head |
Attached Files
file #53935: 0001-Add-MEM_CUSTOM_ALLOCATOR-and-make-LIBC-a-subset-of-i.patch added by paravoid (6KiB - text/x-patch)
Depends on the following items: None found
Items that depend on this one: None found
Carbon-Copy List
There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.
Follows 1 latest change.
Date | Changed by | Updated Field | Previous Value | => | Replaced by |
---|---|---|---|---|---|
2022-11-06 | paravoid | Attached File | - | ![]() |
Added 0001-Add-MEM_CUSTOM_ALLOCATOR-and-make-LIBC-a-subset-of-i.patch, #53935 |
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!