Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/devmanu-de/xmemtools
https://github.com/devmanu-de/xmemtools
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/devmanu-de/xmemtools
- Owner: DevManu-de
- License: mit
- Created: 2021-03-11T13:45:11.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2021-09-03T16:58:42.000Z (over 3 years ago)
- Last Synced: 2023-07-23T22:21:53.263Z (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.