3 #include "contiki-conf.h"
8 asm volatile ("clr r1"); /* No longer needed. */
13 #define STACK_EXTRA 32
14 static char *cur_break
= (char *)(&__bss_end
+ 1);
17 * Allocate memory from the heap. Check that we don't collide with the
18 * stack right now (some other routine might later). A watchdog might
19 * be used to check if cur_break and the stack pointer meet during
27 stack_pointer
= (char *)SP
;
28 stack_pointer
-= STACK_EXTRA
;
29 if(incr
> (stack_pointer
- cur_break
))
30 return (void *)-1; /* ENOMEM */
32 void *old_break
= cur_break
;
35 * If the stack was never here then [old_break .. cur_break] should
36 * be filled with zeros.