Skip to content

SimonRacaud/UNIX_malloc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

UNIX_malloc

Rewriting of unix memory allocation functions

Using only brk and sbrk, rewrite the 5 following C library functions: malloc, calloc, realloc, reallocarray and free.

  void *malloc(size_t size);
  
  void  free(void *ptr);
  
  void *calloc(size_t nmemb, size_t size);
  
  void *realloc(void *ptr, size_t size);
  
  void *reallocarray(void *ptr, size_t nmemb, size_t size);

Allocation Strategy

  • Align your memory on a power of 2.
  • The break is always aligned on a multiple of 2 pages.
  • Implement the best fit algorithm.

About

Rewriting of unix memory allocation functions

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published