SHARE
TWEET

Untitled

a guest Feb 22nd, 2019 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #ifndef _MEM_H_
  2. #define _MEM_H_
  3.  
  4. #include <stddef.h>
  5. #include <stdint.h>
  6. #include <sys/mman.h>
  7. #include <stdbool.h>
  8.  
  9. #define  HEAP_START  ((void*)0x04040000)
  10.  
  11. #pragma pack(push, 1)
  12. typedef struct mem  {
  13.     struct mem* next;
  14.     size_t capacity;
  15.     bool is_free;
  16. } mem;
  17. #pragma pack(pop)
  18.  
  19. void* _malloc(size_t);
  20.  
  21. void  _free(void*);
  22.  
  23. void *merge_chunk(mem *, mem *);
  24.  
  25. void mem_init(mem *, size_t);
  26.  
  27. void *heap_init(size_t);
  28.  
  29. size_t page_align(size_t);
  30. #endif
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top