/* A trivial malloc implementation, adapted from *mallocbyHannuSavolainen1993andMatthiasUrlichs1994
*/
STATIC_RW_DATA unsignedlong malloc_ptr;
STATIC_RW_DATA int malloc_count;
MALLOC_VISIBLE void *malloc(int size)
{ void *p;
if (size < 0) return NULL; if (!malloc_ptr)
malloc_ptr = free_mem_ptr;
malloc_ptr = (malloc_ptr + 7) & ~7; /* Align */
p = (void *)malloc_ptr;
malloc_ptr += size;
if (free_mem_end_ptr && malloc_ptr >= free_mem_end_ptr) return NULL;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.