mem: fix malloc debug config

This patch replaces broken macro RTE_LIBRTE_MALLOC_DEBUG with
RTE_MALLOC_DEBUG.

Fixes: af75078fec ("first public release")
Cc: stable@dpdk.org

Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Acked-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
This commit is contained in:
Xueming Li 2017-09-09 15:33:18 +08:00 committed by Thomas Monjalon
parent f385306357
commit 3cd4e0e883
2 changed files with 7 additions and 9 deletions

View File

@ -53,13 +53,13 @@ struct malloc_elem {
volatile enum elem_state state;
uint32_t pad;
size_t size;
#ifdef RTE_LIBRTE_MALLOC_DEBUG
#ifdef RTE_MALLOC_DEBUG
uint64_t header_cookie; /* Cookie marking start of data */
/* trailer cookie at start + size */
#endif
} __rte_cache_aligned;
#ifndef RTE_LIBRTE_MALLOC_DEBUG
#ifndef RTE_MALLOC_DEBUG
static const unsigned MALLOC_ELEM_TRAILER_LEN = 0;
/* dummy function - just check if pointer is non-null */

View File

@ -108,8 +108,7 @@ test_align_overlap_per_lcore(__attribute__((unused)) void *arg)
}
for(j = 0; j < 1000 ; j++) {
if( *(char *)p1 != 0) {
printf("rte_zmalloc didn't zero"
"the allocated memory\n");
printf("rte_zmalloc didn't zero the allocated memory\n");
ret = -1;
}
}
@ -180,8 +179,7 @@ test_reordered_free_per_lcore(__attribute__((unused)) void *arg)
}
for(j = 0; j < 1000 ; j++) {
if( *(char *)p1 != 0) {
printf("rte_zmalloc didn't zero"
"the allocated memory\n");
printf("rte_zmalloc didn't zero the allocated memory\n");
ret = -1;
}
}
@ -293,7 +291,7 @@ test_multi_alloc_statistics(void)
struct rte_malloc_socket_stats pre_stats, post_stats ,first_stats, second_stats;
size_t size = 2048;
int align = 1024;
#ifndef RTE_LIBRTE_MALLOC_DEBUG
#ifndef RTE_MALLOC_DEBUG
int trailer_size = 0;
#else
int trailer_size = RTE_CACHE_LINE_SIZE;
@ -623,7 +621,7 @@ test_rte_malloc_validate(void)
const size_t request_size = 1024;
size_t allocated_size;
char *data_ptr = rte_malloc(NULL, request_size, RTE_CACHE_LINE_SIZE);
#ifdef RTE_LIBRTE_MALLOC_DEBUG
#ifdef RTE_MALLOC_DEBUG
int retval;
char *over_write_vals = NULL;
#endif
@ -645,7 +643,7 @@ test_rte_malloc_validate(void)
if (allocated_size < request_size)
err_return();
#ifdef RTE_LIBRTE_MALLOC_DEBUG
#ifdef RTE_MALLOC_DEBUG
/****** change the header to be bad */
char save_buf[64];