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:  Fixed
Privacy:  Public Assigned to:  goldsimon
Open/Closed:  Closed Planned Release:  2.2.1
lwIP version:  git head

Wed 11 Oct 2023 07:54:28 PM UTC, comment #1: 

Hey, thanks for the excellent patch!

Simon Goldschmidt <goldsimon>
Group administrator
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 goldsimon (Posted a comment)
  • -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.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2023-10-11 goldsimon StatusNone Fixed
        Assigned toNone goldsimon
        Open/ClosedOpen Closed
        Planned ReleaseNone 2.2.1
    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.13-758e.
    Corresponding source code