[ECOS] New memory allocation debug feature
Nick Garnett
nickg@ecoscentric.com
Thu Jun 17 13:01:00 GMT 2004
Andrew Lunn <andrew@lunn.ch> writes:
> On Thu, Jun 17, 2004 at 12:55:11PM +0200, ?yvind Harboe wrote:
> > Comments?
>
> I would prefer the function to use the cyg_ prefix so it does not
> polute the namespace.
To underline this, the naming convention for eCos is to separate words
in a name with underscores, not to use capitalization. Names should
also contain the subsystem that they belong to and be descriptive of
what they do. I think that the function should probably also have some
arguments indicating, at least, the size of allocation that failed and
the memory pool that has been exhausted.
So I would like to see something more like:
__externC void cyg_memalloc_alloc_fail( CYG_ADDRESS pool, cyg_uint32 size );
In theory this whole thing should be better integrated into the C++
classes that implement the memory allocators, but having an external
function to call is an acceptable first step.
>
> You also need to provide an implementation in libtarget.a for when the
> application does not have such a function. eg all the test programs
> will not provide this function, so will fail to link when your new
> option is enabled. So please add a week function which does nothing,
> or maybe throws an CYG_FAIL().
s/week/weak/ :-)
--
Nick Garnett eCos Kernel Architect
http://www.ecoscentric.com/ The eCos and RedBoot experts
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
More information about the Ecos-discuss
mailing list