Print function name and file location when caught a SIGSEGV

This commit is contained in:
2025-03-12 14:25:55 +01:00
parent 6a5b07fa93
commit 3b938a06dd
7 changed files with 131 additions and 46 deletions

4
da.h
View File

@@ -7,11 +7,11 @@
do { \
if ((da)->count == 0) { \
(da)->capacity = 1; \
(da)->items = malloc(sizeof(item)*sizeof((da)->capacity)); \
(da)->items = (typeof((da)->items))malloc(sizeof(item)*sizeof((da)->capacity)); \
} else { \
if ((da)->count == (da)->capacity) { \
(da)->capacity *= 2; \
(da)->items = realloc((da)->items, (da)->capacity * sizeof((item))); \
(da)->items = (typeof((da)->items))realloc((da)->items, (da)->capacity * sizeof((item))); \
} \
} \
(da)->items[(da)->count++] = (item); \