Browse Source

Cleanup debug code

tags/1.7.0
Carsten Larsen 3 years ago
parent
commit
27fb80dcd9
3 changed files with 11 additions and 16 deletions
  1. +9
    -14
      lib/clib/mem.c
  2. +1
    -1
      lib/clib/memcpy.c
  3. +1
    -1
      lib/clib/memset.c

+ 9
- 14
lib/clib/mem.c View File

@@ -37,10 +37,10 @@
#define FREE_MEM(x) FreeVec(x)
#define Debug(x,y,z)
#else
# include <stdlib.h>
# define ALLOC_MEM(x) calloc(1L,x)
# define FREE_MEM(x) free(x)
# define Debug(x,y,z)
#include <stdlib.h>
#define ALLOC_MEM(x) calloc(1L,x)
#define FREE_MEM(x) free(x)
#define Debug(x,y,z)
#endif

#if defined(__x86_64__) || defined(__aarch64__) || \
@@ -130,9 +130,7 @@ void* AllocMemSafe(size_t size)
list->peak = list->size;
}

// DEBUG code
// Debug(NULL, "Mememory allocated at address (%x)\n", newblock->address);

// Memory allocated
return newblock->address;
}

@@ -179,9 +177,6 @@ void FreeMemSafe(void* block)
current->next = NULL;
current->size = 0;
FREE_MEM(current);

// DEBUG code
// Debug("Mememory deallocated at address (%x)\n", block);
}

/**
@@ -218,17 +213,17 @@ void MemUsage(long *blocks, long *size, long *peak)
}

/**
* @brief Log a mememory allocation error
* @brief Log a memory allocation error
*/
void alloc_error(char *descr, size_t size)
{
Debug("Mememory allocation error (%s) with size (%d)\n", descr, size);
Debug("Memory allocation error (%s) with size (%d)\n", descr, size);
}

/**
* @brief Log a mememory deallocation error
* @brief Log a memory deallocation error
*/
void dealloc_error(char *descr, void *p)
{
Debug("Mememory deallocation error (%s) address (%x)\n", descr, p);
Debug("Memory deallocation error (%s) address (%x)\n", descr, p);
}

+ 1
- 1
lib/clib/memcpy.c View File

@@ -31,7 +31,7 @@
*/

/**
* @file memcpy.h
* @file memcpy.c
* @brief Copy a block of memory, handling overlap.
*
* Code originate from FreeBSD base, revision 229286.


+ 1
- 1
lib/clib/memset.c View File

@@ -31,7 +31,7 @@
*/

/**
* @file memset.h
* @file memset.c
* @brief Fill block of memory with a constant value.
*
* Code originate from FreeBSD base, revision 229286.


Loading…
Cancel
Save