extern "C" {
# include "zbuild.h"
-# include "zutil_p.h"
+# include "zutil.h"
# include "test_cpu_features.h"
}
uint8_t *str1;
uint8_t *str2;
- str1 = (uint8_t *)zng_alloc(MAX_COMPARE_SIZE);
+ str1 = (uint8_t *)PREFIX3(alloc_aligned)(NULL, NULL, 1, MAX_COMPARE_SIZE, 64);
ASSERT_TRUE(str1 != NULL);
memset(str1, 'a', MAX_COMPARE_SIZE);
- str2 = (uint8_t *)zng_alloc(MAX_COMPARE_SIZE);
+ str2 = (uint8_t *)PREFIX3(alloc_aligned)(NULL, NULL, 1, MAX_COMPARE_SIZE, 64);
ASSERT_TRUE(str2 != NULL);
memset(str2, 'a', MAX_COMPARE_SIZE);
str2[i] = 'a';
}
- zng_free(str1);
- zng_free(str2);
+ PREFIX3(free_aligned)(NULL, NULL, str1);
+ PREFIX3(free_aligned)(NULL, NULL, str2);
}
#define TEST_COMPARE256(name, func, support_flag) \
extern "C" {
# include "zbuild.h"
-# include "zutil_p.h"
+# include "zutil.h"
# include "compare256_rle.h"
}
uint8_t str1[] = {'a', 'a', 0};
uint8_t *str2;
- str2 = (uint8_t *)zng_alloc(MAX_COMPARE_SIZE);
+ str2 = (uint8_t *)PREFIX3(alloc_aligned)(NULL, NULL, 1, MAX_COMPARE_SIZE, 64);
ASSERT_TRUE(str2 != NULL);
memset(str2, 'a', MAX_COMPARE_SIZE);
str2[i] = 'a';
}
- zng_free(str2);
+ PREFIX3(free_aligned)(NULL, NULL, str2);
}
#define TEST_COMPARE256_RLE(name, func, support_flag) \
extern "C" {
# include "zbuild.h"
-# include "zutil_p.h"
# include "test_cpu_features.h"
}
void *ptr;
/* If no custom calloc function used then call zlib-ng's aligned calloc */
- if (zalloc == PREFIX(zcalloc))
+ if (zalloc == NULL || zalloc == PREFIX(zcalloc))
return PREFIX(zcalloc)(opaque, items, size);
/* Allocate enough memory for proper alignment and to store the original memory pointer */
void Z_INTERNAL PREFIX3(free_aligned)(zng_cfree_func zfree, void *opaque, void *ptr) {
/* If no custom cfree function used then call zlib-ng's aligned cfree */
- if (zfree == PREFIX(zcfree)) {
+ if (zfree == NULL || zfree == PREFIX(zcfree)) {
PREFIX(zcfree)(opaque, ptr);
return;
}