Skip to content

smalloc is a proof-of-concept (POC) memory allocator that demonstrates an approach to memory management. The key idea is to reserve the beginning of a memory page for storing the status of allocations within that page, while using the rest of the page for the actual allocations.

License

Notifications You must be signed in to change notification settings

FlorealRISSO/smalloc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Minimalist Memory Allocator in C (smalloc)

This project is a proof-of-concept for a minimalist memory allocator (smalloc) designed to allocate and deallocate memory dynamically within a fixed-size memory buffer. It uses a compact metadata system to track memory usage and is capable of functioning without an operating system.

For a detailed explanation of the design, implementation, and use cases, check out the article on smalloc.

Getting Started

Building the Project

Run the following commands to build and test the allocator:

# Build the project
make

# Run tests
make test

Visualizing Memory Dumps

The tools provided can visualize the status array from memory dumps:

  • CLI Viewer: Build and run the viewer.c tool:

    ./viewer dumps/<dump_file>
  • HTML Viewer: Open tools/viewer.html in your browser and load the dump file.

License

This project is licensed under the MIT License. See the LICENSE file for details.

More Information

For an in-depth look into the allocator, its internals, and examples, visit the accompanying article.

About

smalloc is a proof-of-concept (POC) memory allocator that demonstrates an approach to memory management. The key idea is to reserve the beginning of a memory page for storing the status of allocations within that page, while using the rest of the page for the actual allocations.

Topics

Resources

License

Stars

Watchers

Forks