Mail Archives: djgpp-workers/2002/02/28/05:02:54
I have added the following section:
/* This allows a clean connection to debugging software */
static struct sysquery {
byte values[8];
memblockp nil;
} sysquery = { { DATAOFFSET,
offsetof(memblock, guardlo),
offsetof(memblock, sz),
offsetof(memblock, prevfree),
offsetof(memblock, nextfree),
offsetof(memblock, next),
offsetof(memblock, prev),
0 /* reserved for expansion */
},
NONE
};
/* This can return the above values, hopefully in a register */
/* The use of NONE in nextfree, prevfree may cause confusion */
/* Maybe the value of NONE should be a further field?? */
struct sysquery _sysmalloc(void)
{
return sysquery;
} /* _sysmalloc */
The idea is to provide an easy controlled system interface to
debugging tools that have to follow the allocation chains and
sizes around. That is why I have put the routine in the system
name space.
With a few other changes it compiles with NDEBUG defined to create
a system module. The object code size (still without realloc
implemented) is about half that of the present malloc module at
around 1500 bytes More like 2k when inlined. Realloc is going to
be able to avoid much copying.
--
Chuck F (cbfalconer AT yahoo DOT com) (cbfalconer AT XXXXworldnet DOT att DOT net)
Available for consulting/temporary embedded and systems.
(Remove "XXXX" from reply address. yahoo works unmodified)
mailto:uce AT ftc DOT gov (for spambots to harvest)
- Raw text -