Compare commits

..

No commits in common. "39c25e5a17b0bb5baa321ca8e7551a001ec91ea1" and "4903c075e850d34bd704f188eb95b0f9e19e2579" have entirely different histories.

View file

@ -40,12 +40,10 @@
#define MEMORY_HEXDUMP_WIDTH 16
#endif
#define MEMORY_FILE_SIZE 256
struct MemoryInfo
{
size_t size;
char file[MEMORY_FILE_SIZE];
const char *file;
int line;
void *pointer;
};
@ -229,7 +227,7 @@ MemoryAllocate(size_t size, const char *file, int line)
MEM_BOUND_UPPER(p, size) = MEM_BOUND;
a->size = MEM_SIZE_ACTUAL(size);
strncpy(a->file, file, MEMORY_FILE_SIZE - 1);
a->file = file;
a->line = line;
a->pointer = p;
@ -272,7 +270,7 @@ MemoryReallocate(void *p, size_t size, const char *file, int line)
{
MemoryDelete(a);
a->size = MEM_SIZE_ACTUAL(size);
strncpy(a->file, file, MEMORY_FILE_SIZE - 1);
a->file = file;
a->line = line;
a->pointer = new;
@ -295,7 +293,7 @@ MemoryReallocate(void *p, size_t size, const char *file, int line)
if (a)
{
a->size = 0;
strncpy(a->file, file, MEMORY_FILE_SIZE - 1);
a->file = file;
a->line = line;
a->pointer = p;
hook(MEMORY_BAD_POINTER, a, hookArgs);
@ -324,7 +322,7 @@ MemoryFree(void *p, const char *file, int line)
pthread_mutex_lock(&lock);
if (hook)
{
strncpy(a->file, file, MEMORY_FILE_SIZE - 1);
a->file = file;
a->line = line;
hook(MEMORY_FREE, a, hookArgs);
}
@ -339,7 +337,7 @@ MemoryFree(void *p, const char *file, int line)
a = malloc(sizeof(MemoryInfo));
if (a)
{
strncpy(a->file, file, MEMORY_FILE_SIZE - 1);
a->file = file;
a->line = line;
a->size = 0;
a->pointer = p;