summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xs.h10
-rw-r--r--xs_version.h2
2 files changed, 6 insertions, 6 deletions
diff --git a/xs.h b/xs.h
index 6f3a0ed..7900ea0 100644
--- a/xs.h
+++ b/xs.h
@@ -35,8 +35,8 @@ typedef char d_char;
35#define xs __attribute__ ((__cleanup__ (_xs_destroy))) d_char 35#define xs __attribute__ ((__cleanup__ (_xs_destroy))) d_char
36 36
37void *xs_free(void *ptr); 37void *xs_free(void *ptr);
38void *_xs_realloc(void *ptr, size_t size, const char *file, int line); 38void *_xs_realloc(void *ptr, size_t size, const char *file, int line, const char *func);
39#define xs_realloc(ptr, size) _xs_realloc(ptr, size, __FILE__, __LINE__) 39#define xs_realloc(ptr, size) _xs_realloc(ptr, size, __FILE__, __LINE__, __FUNCTION__)
40int _xs_blk_size(int sz); 40int _xs_blk_size(int sz);
41void _xs_destroy(char **var); 41void _xs_destroy(char **var);
42#define xs_debug() raise(SIGTRAP) 42#define xs_debug() raise(SIGTRAP)
@@ -85,7 +85,7 @@ const char *xs_number_str(const char *v);
85 85
86#ifdef XS_IMPLEMENTATION 86#ifdef XS_IMPLEMENTATION
87 87
88void *_xs_realloc(void *ptr, size_t size, const char *file, int line) 88void *_xs_realloc(void *ptr, size_t size, const char *file, int line, const char *func)
89{ 89{
90 d_char *ndata = realloc(ptr, size); 90 d_char *ndata = realloc(ptr, size);
91 91
@@ -99,9 +99,9 @@ void *_xs_realloc(void *ptr, size_t size, const char *file, int line)
99 FILE *f = fopen("xs_memory.out", "a"); 99 FILE *f = fopen("xs_memory.out", "a");
100 100
101 if (ptr != NULL) 101 if (ptr != NULL)
102 fprintf(f, "%p b\n", ptr); 102 fprintf(f, "%p r\n", ptr);
103 103
104 fprintf(f, "%p a %ld %s %d\n", ndata, size, file, line); 104 fprintf(f, "%p a %ld %s %d %s\n", ndata, size, file, line, func);
105 fclose(f); 105 fclose(f);
106 } 106 }
107#endif 107#endif
diff --git a/xs_version.h b/xs_version.h
index fc3a46e..4ed093c 100644
--- a/xs_version.h
+++ b/xs_version.h
@@ -1 +1 @@
/* 223ebe7a241f24ba043b32cb30d0428ac0d1dd5f */ /* 286f556255aa224a72b778c44b837b75170becf5 */