PitAlloc is a basic memory allocator written in C++ that uses a bucket system. It is inspired by partition alloc and is currently a Proof of Concept (PoC).
- Bucket-based memory allocation
- Singleton design pattern for allocator instance
- Basic error handling
- Allocation and deallocation (free) functions
- Supports limited allocation sizes
- C++ compiler (e.g., g++, clang++)
To compile the project, use the following commands in your terminal:
git clone https://github.com/P1tt1cus/PitAlloc.git
cd PitAlloc
clang++ -o *.cc -std=c++11
Below is an example of how to use PitAlloc:
#include "shim_cpp_exports.h"
int main() {
// Allocate memory using overridden new operator
int* ptr = new int[10];
// Use allocated memory
// ...
// Free allocated memory using overridden delete operator
delete[] ptr;
return 0;
}