diff --git a/src/Memory.c b/src/Memory.c index b3a6920..aec5d51 100644 --- a/src/Memory.c +++ b/src/Memory.c @@ -31,7 +31,6 @@ struct MemoryInfo { size_t size; const char *file; - const char *func; int line; void *pointer; @@ -45,7 +44,7 @@ static void (*hook) (MemoryAction, MemoryInfo *, void *) = NULL; static void *hookArgs = NULL; void * -MemoryAllocate(size_t size, const char *file, int line, const char *func) +MemoryAllocate(size_t size, const char *file, int line) { void *p; MemoryInfo *a; @@ -70,7 +69,6 @@ MemoryAllocate(size_t size, const char *file, int line, const char *func) a->size = size; a->file = file; a->line = line; - a->func = func; a->pointer = p; a->next = NULL; a->prev = lastAllocation; @@ -261,17 +259,6 @@ MemoryInfoGetFile(MemoryInfo * a) return a->file; } -const char * -MemoryInfoGetFunc(MemoryInfo * a) -{ - if (!a) - { - return NULL; - } - - return a->func; -} - int MemoryInfoGetLine(MemoryInfo * a) { diff --git a/src/Telodendria.c b/src/Telodendria.c index 4cc98bc..44a7f80 100644 --- a/src/Telodendria.c +++ b/src/Telodendria.c @@ -63,9 +63,9 @@ TelodendriaMemoryHook(MemoryAction a, MemoryInfo * i, void *args) break; } - Log(lc, LOG_DEBUG, "%s:%d %s(): %s %lu bytes of memory at %p.", + Log(lc, LOG_DEBUG, "%s:%d: %s %lu bytes of memory at %p.", MemoryInfoGetFile(i), MemoryInfoGetLine(i), - MemoryInfoGetFunc(i), action, MemoryInfoGetSize(i), + action, MemoryInfoGetSize(i), MemoryInfoGetPointer(i)); } @@ -77,8 +77,8 @@ TelodendriaMemoryIterator(MemoryInfo * i, void *args) /* We haven't freed the logger memory yet */ if (MemoryInfoGetPointer(i) != lc) { - Log(lc, LOG_DEBUG, "%lu bytes of memory at %p leaked from %s() (%s:%d)", - MemoryInfoGetSize(i), MemoryInfoGetPointer(i), MemoryInfoGetFunc(i), + Log(lc, LOG_DEBUG, "%lu bytes of memory at %p leaked from %s:%d", + MemoryInfoGetSize(i), MemoryInfoGetPointer(i), MemoryInfoGetFile(i), MemoryInfoGetLine(i)); } } diff --git a/src/include/Memory.h b/src/include/Memory.h index bdc1baa..933d3f5 100644 --- a/src/include/Memory.h +++ b/src/include/Memory.h @@ -33,13 +33,13 @@ typedef enum MemoryAction MEMORY_FREE } MemoryAction; -#define Malloc(x) MemoryAllocate(x, __FILE__, __LINE__, __FUNCTION__) +#define Malloc(x) MemoryAllocate(x, __FILE__, __LINE__) #define Realloc(x, s) MemoryReallocate(x, s) #define Free(x) MemoryFree(x) typedef struct MemoryInfo MemoryInfo; -extern void *MemoryAllocate(size_t, const char *, int, const char *); +extern void *MemoryAllocate(size_t, const char *, int); extern void *MemoryReallocate(void *, size_t); extern void MemoryFree(void *); @@ -50,7 +50,6 @@ extern MemoryInfo *MemoryInfoGet(void *); extern size_t MemoryInfoGetSize(MemoryInfo *); extern const char *MemoryInfoGetFile(MemoryInfo *); -extern const char *MemoryInfoGetFunc(MemoryInfo *); extern int MemoryInfoGetLine(MemoryInfo *); extern void *MemoryInfoGetPointer(MemoryInfo *);