Remove unused isc_mem_createx() function

The isc_mem_createx() function was only used in the tests to eliminate using the
default flags (which as of writing this commit message was ISC_MEMFLAG_INTERNAL
and ISC_MEMFLAG_FILL).  This commit removes the isc_mem_createx() function from
the public API.
This commit is contained in:
Ondřej Surý
2019-09-06 11:31:15 +02:00
parent 4957255d13
commit 19fbdef31e
6 changed files with 50 additions and 114 deletions

View File

@@ -31,21 +31,6 @@
#include <isc/string.h>
#include <isc/util.h>
static void *
default_memalloc(void *arg, size_t size) {
UNUSED(arg);
if (size == 0U) {
size = 1;
}
return (malloc(size));
}
static void
default_memfree(void *arg, void *ptr) {
UNUSED(arg);
free(ptr);
}
static void
test_ht_full(int bits, uintptr_t count) {
isc_ht_t *ht = NULL;
@@ -53,8 +38,7 @@ test_ht_full(int bits, uintptr_t count) {
isc_mem_t *mctx = NULL;
uintptr_t i;
isc_mem_createx(default_memalloc, default_memfree,
NULL, &mctx, 0);
isc_mem_create(&mctx);
result = isc_ht_init(&ht, mctx, bits);
assert_int_equal(result, ISC_R_SUCCESS);
@@ -206,8 +190,7 @@ test_ht_iterator() {
unsigned char key[16];
size_t tksize;
isc_mem_createx(default_memalloc, default_memfree,
NULL, &mctx, 0);
isc_mem_create(&mctx);
result = isc_ht_init(&ht, mctx, 16);
assert_int_equal(result, ISC_R_SUCCESS);