https://github.com/bagnalla/malloc
An implementation of the C dynamic memory allocation functions malloc, free, calloc, and realloc.
https://github.com/bagnalla/malloc
Last synced: 3 months ago
JSON representation
An implementation of the C dynamic memory allocation functions malloc, free, calloc, and realloc.
- Host: GitHub
- URL: https://github.com/bagnalla/malloc
- Owner: bagnalla
- Created: 2016-03-03T23:48:00.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-12-05T01:01:06.000Z (over 7 years ago)
- Last Synced: 2025-01-21T10:50:57.188Z (5 months ago)
- Language: C
- Homepage:
- Size: 118 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# malloc
An implementation of the C dynamic memory allocation functions malloc, free, calloc, and realloc.The memory overhead for block metadata is larger than the standard implementation which is most noticeable when doing a lot of small allocations.
The heap size is managed via the glibc sbrk() function. Allocation requests >= 256kB are allocated with mmap instead of growing the heap.
Thread safety is guaranteed by a pthread mutex.
Beware though, errors will not result in a nice exception like bad_alloc.A couple test programs along with a makefile are included.