#include "../cpu/memory.h" #include "string.h" #include "stdlib.h" #include "math.h" #include #define MAX_BLOCKS 512 typedef struct { char* bitmap; uint32_t bitmap_byt_size; uint32_t bitmap_bit_size; uint32_t avail_data_size; void* data_block; } heap_block; static heap_block entries[MAX_BLOCKS]; static uint32_t num_used_entries=0; static char get_bmap_bit(char* bmap,uint32_t index) { uint32_t byte=index/8; uint32_t bit=index%8; char entry=bmap[byte]; return (entry&(1<0; } static void set_bmap_bit(char* bmap,uint32_t index) { uint32_t byte=index/8; uint32_t bit=index%8; bmap[byte]=bmap[byte]|(1<=size) { char* bmap=entry.bitmap; uint32_t bmap_byt_sz=entry.bitmap_byt_size; for(uint32_t i=0;i