1 #include "src/lib/lib_head.h"
4 void wait(clock_t wait);
5 void* AllocateLargestFreeBlock(size_t* Size);
6 size_t GetFreeSize(void);
\r
8 /* Function: Wait **********************************************************
\r
10 * Parameters: wait - time in microseconds
\r
12 * Description: pauses for a specified number of microseconds.
\r
15 void wait(clock_t wait){
\r
20 goal = wait + clock();
\r
21 while((goal > clock()) && !kbhit()) ;
\r
24 void* AllocateLargestFreeBlock(size_t* Size)
29 s0 = ~(size_t)0 ^ (~(size_t)0 >> 1);
31 while (s0 && (p = malloc(s0)) == NULL)
41 if ((p = malloc(s0 + s1)) != NULL)
49 while (s0 && (p = malloc(s0)) == NULL)
56 size_t GetFreeSize(void)
65 void* p = AllocateLargestFreeBlock(&largest);
67 if (largest < sizeof(void*))
87 while (pFirst != NULL)
89 void* p = *(void**)pFirst;