https://github.com/devmanu-de/xmemtools
https://github.com/devmanu-de/xmemtools
Last synced: 6 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/devmanu-de/xmemtools
- Owner: DevManu-de
- License: mit
- Created: 2021-03-11T13:45:11.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-09-03T16:58:42.000Z (almost 5 years ago)
- Last Synced: 2025-02-27T07:23:05.953Z (over 1 year ago)
- Language: C
- Homepage:
- Size: 48.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# xmemtools
xmemtools provides safer alternatives to memory functions like `malloc`
## Description
### xmalloc
allocates a block of memory and ruturns a pointer to it.
### xcalloc
allocates a block of memory and sets it to 0 and returns a pointer to it.
### xrealloc
reallocates a allocated block and returns a pointer to it.
### xfree
frees an allocated block of memory.
### xmemdup
douplicates a block of memory and returns a pointer to the allocated block.
All functions `assert` if allocation failed.
### xstrdiff
compares 2 strings and returns a pointer to the first different char in s1.
## Usage
All functions behave like their `stdlib.h` functions just that these add some safety.