Replace DEVELOPMENT with LWMEM_DEV

This commit is contained in:
tilz0R 2019-06-21 18:02:41 +02:00
parent 0fc6d5e688
commit 0c7c8c930b
2 changed files with 9 additions and 9 deletions

View File

@ -74,13 +74,13 @@ unsigned char LWMEM_PREF(realloc_s)(void** const ptr, const size_t size);
void LWMEM_PREF(free)(void* const ptr);
void LWMEM_PREF(free_s)(void** const ptr);
#if defined(DEVELOPMENT) && !__DOXYGEN__
#if defined(LWMEM_DEV) && !__DOXYGEN__
unsigned char lwmem_debug_create_regions(LWMEM_PREF(region_t)** regs_out, size_t count, size_t size);
void lwmem_debug_save_state(void);
void lwmem_debug_restore_to_saved(void);
void lwmem_debug_print(unsigned char print_alloc, unsigned char print_free);
#endif /* defined(DEVELOPMENT) && !__DOXYGEN__ */
#endif /* defined(LWMEM_DEV) && !__DOXYGEN__ */
#undef LWMEM_PREF

View File

@ -167,9 +167,9 @@ typedef struct lwmem {
lwmem_block_t* end_block; /*!< Pointer to the last memory location in regions linked list */
size_t mem_available_bytes; /*!< Memory size available for allocation */
size_t mem_regions_count; /*!< Number of regions used for allocation */
#if defined(DEVELOPMENT) && !__DOXYGEN__
#if defined(LWMEM_DEV) && !__DOXYGEN__
lwmem_block_t start_block_first_use; /*!< Value of start block for very first time */
#endif /* defined(DEVELOPMENT) && !__DOXYGEN__ */
#endif /* defined(LWMEM_DEV) && !__DOXYGEN__ */
} lwmem_t;
/**
@ -458,10 +458,10 @@ LWMEM_PREF(assignmem)(const LWMEM_PREF(region_t)* regions, const size_t len) {
lwmem.mem_regions_count++; /* Increase number of used regions */
}
#if defined(DEVELOPMENT)
#if defined(LWMEM_DEV)
/* Copy default state of start block */
LWMEM_MEMCPY(&lwmem.start_block_first_use, &lwmem.start_block, sizeof(lwmem.start_block));
#endif /* defined(DEVELOPMENT) */
#endif /* defined(LWMEM_DEV) */
return lwmem.mem_regions_count; /* Return number of regions used by manager */
}
@ -804,10 +804,10 @@ LWMEM_PREF(free_s)(void** const ptr) {
}
}
/* Part of library used ONLY for development purposes */
/* Part of library used ONLY for LWMEM_DEV purposes */
/* To validate and test library */
#if defined(DEVELOPMENT) && !__DOXYGEN__
#if defined(LWMEM_DEV) && !__DOXYGEN__
#include <stdio.h>
#include <stdlib.h>
@ -943,4 +943,4 @@ lwmem_debug_restore_to_saved(void) {
printf(" -- > State restored to last saved!\r\n");
}
#endif /* defined(DEVELOPMENT) && !__DOXYGEN__ */
#endif /* defined(LWMEM_DEV) && !__DOXYGEN__ */