This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Re: [PATCH] malloc on top to consider already available memory
- From: Freddie Chopin <freddie_chopin at op dot pl>
- To: newlib at sourceware dot org
- Date: Thu, 18 Feb 2016 09:20:02 +0100
- Subject: Re: [PATCH] malloc on top to consider already available memory
- Authentication-results: sourceware.org; auth=none
- References: <56BDF8FA dot 1080308 at precisebiometrics dot com> <20160215134418 dot GB18211 at calimero dot vinschen dot de> <56C1FB6D dot 4000304 at precisebiometrics dot com> <1455614610 dot 1353 dot 5 dot camel at op dot pl> <20160217164817 dot GG29076 at calimero dot vinschen dot de> <56C57C3F dot 2010608 at precisebiometrics dot com>
On czw, 2016-02-18 at 09:09 +0100, Petter Ãsterlund wrote:
> For my case nano-malloc is not what I use but going to dlmalloc 2.8
> seems reasonable and possibly even consume a bit less global malloc
> state RAM (by the look of the code). Version 2.8 also comes with
> support of malloc spaces which could be useful in some cases to
> handle
> fragmentation issues e.g. I guess there is a bit of work to get the
> newlib special #ifdefs and defines to support e.g. reent.
It would be very nice to have the most recent dlmalloc in newlib! I can
help you with that or I may try to integrate it myself. I think that
all newlib-specific additions should be somehow marked and possibly
grouped, to make all future updates of this code easier. Sth like
--- >8 --- >8 --- >8 --- >8 --- >8 ---
... beginning of original dlmalloc code
// ============== NEWLIB BEGIN ==============
... newlib specific defines, includes, whatever...
// ============== NEWLIB END ==============
... rest of original dlmalloc code
--- >8 --- >8 --- >8 --- >8 --- >8 ---
Assuming that it would be possible to do it that way... I was thinking
about that some time ago and tried to compare newlib to original
dlmalloc code (different versions), but it seems that the codebases
diverged significantly...
Corina mentionedÂjemalloc and ptmalloc3, but from what I read yesterday
I think that these may be a bit too heavy for newlib if it would be
used for a microcontroller... On the other hand newlib-nano is not
really an option for me as it is single-threaded...
Regards,
FCh