Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

kosmios1/memory_allocators

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Memory Allocators

An allocator allocate a block of memory (on the heap) and manages it, this make allocators more efficent than using malloc and free directly, moreover the risk of not freeing a portion of memory is lower.

This library implements different kinds of allocators:

  • Linear: Allocate memory linearly (the internal fragmentation is minimal); can only release the entire block of memory.
  • Stack: Similar to the linear allocator but uses headers that permit to free and reuse the memory.
  • Pool: Allocate memory that is divided in chunks of the same size. Each free chunk's pointer is stored in a linked list and when a chunk is allocated(/free) is removed(/added) to the linked list. The major downsize is that each chunk must be of the same size.

Build and Integration in project

This project is an header only library so you can take this file and drop in your project or use cmake to import it.

Releases

No releases published

Packages

No packages published