/*file malloc.c Memory Allocation Function EMR 990407 MRR 000327 */ /* Memory Allocation Function */ int *malloc(unsigned int size) { static int buffer[2048]; static int *next = buffer; int *p = next; next += ((size + 7) & ~7); if (next >= &buffer[0] + sizeof(buffer)) /* Terminate by executing a zero. */ asm(".long 0"); /* This will not work on all compilers! */ return p; }