Hi,

how can i detect if the heap is used?
Because 99,9 % of the programs don't use malloc, and alloca can often
be used instead, only malloc is no problem. 

Regards,

Rolf


mspgcc-users@lists.sourceforge.net schrieb am 27.08.05 08:32:38:
> 
> At 03:22 27-08-05 +0200, you wrote:
> >nobo...@web.de wrote:
> >> in the stackcheck example &_end is used for the stack check 
> >> and the comment says that _end is defined by the linker.
> >> Because the heap begins behind the bss segment and grows
> >> towards the stack this seem to mean that stackcheck can only work
> >> if the heap is unused.
> >> Is this right?
> >
> >yes
> >
> >
> >if you have a heap (use of malloc/free) then the stack check has to be 
> >done differently. one solution is to preclaculate a lowest allowed 
> >address and put the stackmarker there:
> >
> >  extern unsigned short __stack;
> >  unsigned short *address = (unsigned short *)(__stack-50);
> >
> 
> Or write a small wrapper around malloc which determines which address is
> still available for the stack.
> 
> Nico Coesel
> 
> 
> 
> -------------------------------------------------------
> SF.Net email is Sponsored by the Better Software Conference & EXPO
> September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
> Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
> Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
> _______________________________________________
> Mspgcc-users mailing list
> Mspgcc-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mspgcc-users



Reply via email to