ruth561 / salloc

simple memory allocator

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Simple Allocator

This is a very simple memory allocator, created to test the heaphook itself.

How to build

Firstly, you need to create a heaphook environment.

$ mkdir -p /path/to/heaphook_ws && cd /path/to/heaphook_ws
$ mkdir src & git clone https://github.com/ruth561/heaphook src/heaphook

Next, clone this repository under the src directory of heaphook.

$ git clone git@github.com:ruth561/salloc.git src/heaphook/src/salloc

Finally, add the following text to the CMakeLists.txt file of heaphook.

...

add_subdirectory(src/salloc) # <-- add!

ament_package()

Once these are done, you can build by colcon.

$ colcon build

How to use

After building, you can use libsalloc.so like the following.

$ source install/setup.bash
$ LD_PRELOAD=libsalloc.so executable

About

simple memory allocator

License:Apache License 2.0


Languages

Language:C++ 84.0%Language:CMake 16.0%