This is the mail archive of the
mailing list for the newlib project.
Re: [PATCH newlib]An alternative implementation of malloc family's functions with small foot-print
- From: Corinna Vinschen <vinschen at redhat dot com>
- To: newlib at sourceware dot org
- Date: Tue, 28 May 2013 12:44:59 +0200
- Subject: Re: [PATCH newlib]An alternative implementation of malloc family's functions with small foot-print
- References: <004501ce4fad$4301c8d0$c9055a70$ at firstname.lastname@example.org>
- Reply-to: newlib at sourceware dot org
On May 13 15:41, Bin Cheng wrote:
> Hi all,
> As a part of our library work in GNU Tools for ARM Embedded Processors, we
> implemented an alternative implementation of malloc family's functions with
> small foot-print.
> We have discussed before how to integrate the code with newlib and it seems
> reasonable to have a configuration option to control it.
> So this patch introduces new implementation of malloc functions in file
> "nano-mallocr.c" and a new option "--enable-newlib-nano-malloc" to control
> it. The option is disabled by default so it won't change the default
> We have done lots of internal review work and the code has been applied in
> GNU Tools for ARM Embedded Processor and used for a while, is it OK? Any
> comments will be highly appreciated.
> As for the documentation, I will try to describe newlib's configuration
> options including this one in readme later.
> + --enable-newlib-nano-malloc use nano version malloc implementation
Using the word "nano" here *might* imply that the malloc implementation
is a low-size one, but it isn't really clear, IMHO. Wouldn't something
like "tiny" be more clear? Alternatively, if you like the nano name, I
think it would be helpful to at least add to the description here, along
the lines of
--enable-newlib-nano-malloc use small-footprint nano-malloc implementation
> +#ifndef max
> +#define max(a,b) ((a) >= (b) ? (a) : (b))
I'd prefer if you just include <sys/param.h> and use the uppercase MAX()
Other than that, I think this is ok for inclusion.