mirror of
https://github.com/MaJerle/lwmem.git
synced 2025-01-20 01:52:52 +08:00
Replace DEVELOPMENT with LWMEM_DEV
This commit is contained in:
parent
0fc6d5e688
commit
0c7c8c930b
@ -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)(void* const ptr);
|
||||||
void LWMEM_PREF(free_s)(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);
|
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_save_state(void);
|
||||||
void lwmem_debug_restore_to_saved(void);
|
void lwmem_debug_restore_to_saved(void);
|
||||||
|
|
||||||
void lwmem_debug_print(unsigned char print_alloc, unsigned char print_free);
|
void lwmem_debug_print(unsigned char print_alloc, unsigned char print_free);
|
||||||
#endif /* defined(DEVELOPMENT) && !__DOXYGEN__ */
|
#endif /* defined(LWMEM_DEV) && !__DOXYGEN__ */
|
||||||
|
|
||||||
#undef LWMEM_PREF
|
#undef LWMEM_PREF
|
||||||
|
|
||||||
|
@ -167,9 +167,9 @@ typedef struct lwmem {
|
|||||||
lwmem_block_t* end_block; /*!< Pointer to the last memory location in regions linked list */
|
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_available_bytes; /*!< Memory size available for allocation */
|
||||||
size_t mem_regions_count; /*!< Number of regions used 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 */
|
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;
|
} 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 */
|
lwmem.mem_regions_count++; /* Increase number of used regions */
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(DEVELOPMENT)
|
#if defined(LWMEM_DEV)
|
||||||
/* Copy default state of start block */
|
/* Copy default state of start block */
|
||||||
LWMEM_MEMCPY(&lwmem.start_block_first_use, &lwmem.start_block, sizeof(lwmem.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 */
|
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 */
|
/* To validate and test library */
|
||||||
|
|
||||||
#if defined(DEVELOPMENT) && !__DOXYGEN__
|
#if defined(LWMEM_DEV) && !__DOXYGEN__
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@ -943,4 +943,4 @@ lwmem_debug_restore_to_saved(void) {
|
|||||||
printf(" -- > State restored to last saved!\r\n");
|
printf(" -- > State restored to last saved!\r\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* defined(DEVELOPMENT) && !__DOXYGEN__ */
|
#endif /* defined(LWMEM_DEV) && !__DOXYGEN__ */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user