Skip to content

prasanth-vedula/embedded-memory-allocator-suite

Repository files navigation

Embedded Memory Allocator Suite

A production-style modular memory management framework written in ANSI C for embedded systems.

Language Platform Compiler License Status


Overview

Embedded Memory Allocator Suite is a production-inspired memory management library developed in ANSI C for embedded systems. The project demonstrates multiple dynamic memory allocation algorithms, fragmentation analysis, heap visualization, memory profiling, and reusable allocator APIs.

The project has been designed with modularity, portability, readability, and embedded-system best practices in mind, making it suitable as both a learning resource and a portfolio-quality systems programming project.


Features

  • First Fit Allocator
  • Best Fit Allocator
  • Pool Allocator
  • Buddy Allocator
  • Slab Allocator
  • Heap Statistics
  • Fragmentation Analyzer
  • Heap Profiler
  • Memory Layout Visualizer
  • Modular API Design
  • Portable ANSI C Implementation
  • GCC Compatible
  • Bare-Metal Friendly
  • RTOS Ready Architecture
  • Production-style Documentation

Supported Allocation Algorithms

Allocator Status Purpose
First Fit Fast sequential allocation
Best Fit Reduced fragmentation
Pool Allocator Fixed-size object allocation
Buddy Allocator Efficient block splitting and merging
Slab Allocator Kernel/object allocation
Heap Profiler Runtime allocation statistics
Fragmentation Analyzer Memory fragmentation analysis
Memory Visualizer Heap layout visualization

Repository Structure

embedded-memory-allocator-suite/
│
├── allocator/
│   ├── Inc/
│   └── Src/
│
├── examples/
│
├── tests/
│
├── docs/
│
├── screenshots/
│
├── build/
│
├── README.md
├── LICENSE
├── .gitignore
└── CMakeLists.txt

Architecture

                +----------------------+
                |     Application      |
                +----------+-----------+
                           |
                           |
                +----------v-----------+
                |   Allocator API      |
                +----------+-----------+
                           |
      +--------------------+----------------------+
      |         |          |          |           |
      |         |          |          |           |
+-----v--+ +----v----+ +---v----+ +---v----+ +----v----+
|FirstFit| |Best Fit | | Pool   | | Buddy  | | Slab    |
+---------+ +---------+ +--------+ +--------+ +---------+
                           |
                           |
                    Heap Statistics
                           |
                    Fragmentation
                           |
                     Memory Profiler
                           |
                    Heap Visualizer

Build Instructions

Compile using GCC:

gcc -Wall -I"..\\allocator\\Inc" allocator.c allocator_module.c demo.c -o demo.exe

Run:

demo.exe

Example Outputs

The repository contains executable demonstrations for each allocator implementation.

Available demonstrations include:

  • First Fit
  • Best Fit
  • Pool Allocator
  • Buddy Allocator
  • Slab Allocator
  • Heap Profiler
  • Fragmentation Analyzer
  • Memory Visualizer

Screenshots

Heap Profiler

Heap Profiler


Fragmentation Analyzer

Fragmentation


Memory Visualizer

Memory Visualizer


Pool Allocator

Pool Allocator


Buddy Allocator

Buddy Allocator


Slab Allocator

Slab Allocator


First Fit

First Fit


Best Fit

Best Fit


Skills Demonstrated

  • Embedded Systems Programming
  • Embedded C
  • Dynamic Memory Allocation
  • Pointer Arithmetic
  • Data Structures
  • Heap Management
  • Fragmentation Analysis
  • Performance Profiling
  • API Design
  • Software Architecture
  • Modular Programming
  • Bare-Metal Programming
  • GCC Toolchain
  • Documentation
  • Debugging

Applications

  • RTOS Development
  • Embedded Firmware
  • IoT Devices
  • Automotive Systems
  • Industrial Controllers
  • Robotics
  • Microcontroller Projects
  • Educational Demonstrations

Future Enhancements

  • FreeRTOS Integration
  • Thread-safe Allocators
  • Lock-free Memory Pools
  • DMA-aware Allocation
  • Memory Leak Detection
  • Benchmark Framework
  • ARM Cortex-M Optimization
  • GitHub Actions CI/CD

Author

Vedula China Venkata Prasanth

Electronics and Communication Engineering

Embedded Systems | Firmware Development | Memory Management | Embedded C


License

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

About

Production-style Embedded Memory Allocator Suite written in ANSI C featuring First Fit, Best Fit, Pool, Buddy, and Slab allocators with heap profiling, fragmentation analysis, memory visualization, and modular embedded APIs.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors