Created
April 23, 2020 03:00
-
-
Save struct/8b5333ae362f258edbf17cad36a337e7 to your computer and use it in GitHub Desktop.
Open every C source and header file in a directory and replace calls to system malloc with iso_alloc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
## See https://github.com/struct/isoalloc | |
find . -name "*.[c|h]" | xargs sed -i -e 's/ malloc(/ iso_alloc(/g' \ | |
-e 's/ realloc(/ iso_realloc(/g' \ | |
-e 's/ calloc(/ iso_calloc(/g' \ | |
-e 's/ free(/ iso_free(/g' \ | |
-e 's/ strdup(/ iso_strdup(/g' \ | |
-e 's/ strndup(/ iso_strndup(/g' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment