buglwIP - 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

Sun 06 Nov 2022 04:57:55 PM UTC, original submission:  

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!

Faidon Liambotis <paravoid>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by paravoid (Submitted the item)
  •  

    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

    Back to the top

    Powered by Savane 3.12