mirror of
https://github.com/isc-projects/bind9.git
synced 2026-05-28 04:34:54 -04:00
Use the semantic patch to change the usage isc_mem_create() to new API
This commit is contained in:
parent
6bd2eb06cb
commit
4957255d13
85 changed files with 117 additions and 246 deletions
|
|
@ -127,9 +127,7 @@ add(char *key, int value) {
|
|||
isc_symvalue_t symvalue;
|
||||
|
||||
if (sym_mctx == NULL) {
|
||||
result = isc_mem_create(0, 0, &sym_mctx);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
return;
|
||||
isc_mem_create(&sym_mctx);
|
||||
}
|
||||
|
||||
if (symtab == NULL) {
|
||||
|
|
|
|||
|
|
@ -585,7 +585,7 @@ main(int argc, char **argv) {
|
|||
}
|
||||
isc_commandline_reset = true;
|
||||
|
||||
RUNTIME_CHECK(isc_mem_create(0, 0, &mctx) == ISC_R_SUCCESS);
|
||||
isc_mem_create(&mctx);
|
||||
|
||||
while ((c = isc_commandline_parse(argc, argv, CMDLINE_FLAGS)) != EOF) {
|
||||
switch (c) {
|
||||
|
|
|
|||
|
|
@ -517,7 +517,7 @@ main(int argc, char **argv) {
|
|||
InitSockets();
|
||||
#endif
|
||||
|
||||
RUNTIME_CHECK(isc_mem_create(0, 0, &mctx) == ISC_R_SUCCESS);
|
||||
isc_mem_create(&mctx);
|
||||
if (!quiet)
|
||||
RUNTIME_CHECK(setup_logging(mctx, errout, &lctx)
|
||||
== ISC_R_SUCCESS);
|
||||
|
|
|
|||
|
|
@ -207,7 +207,7 @@ main(int argc, char **argv) {
|
|||
/* Use canonical algorithm name */
|
||||
algname = alg_totext(alg);
|
||||
|
||||
DO("create memory context", isc_mem_create(0, 0, &mctx));
|
||||
isc_mem_create(&mctx);
|
||||
|
||||
if (keyname == NULL) {
|
||||
const char *suffix = NULL;
|
||||
|
|
|
|||
|
|
@ -209,7 +209,7 @@ main(int argc, char **argv) {
|
|||
keysize = alg_bits(alg);
|
||||
algname = alg_totext(alg);
|
||||
|
||||
DO("create memory context", isc_mem_create(0, 0, &mctx));
|
||||
isc_mem_create(&mctx);
|
||||
isc_buffer_init(&key_txtbuffer, &key_txtsecret, sizeof(key_txtsecret));
|
||||
|
||||
generate_key(mctx, alg, keysize, &key_txtbuffer);
|
||||
|
|
|
|||
|
|
@ -1642,9 +1642,7 @@ main(int argc, char *argv[]) {
|
|||
if (result != ISC_R_SUCCESS)
|
||||
fatal("dns_lib_init failed: %d", result);
|
||||
|
||||
result = isc_mem_create(0, 0, &mctx);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
fatal("failed to create mctx");
|
||||
isc_mem_create(&mctx);
|
||||
|
||||
CHECK(isc_appctx_create(mctx, &actx));
|
||||
CHECK(isc_taskmgr_createinctx(mctx, 1, 0, &taskmgr));
|
||||
|
|
|
|||
|
|
@ -1365,8 +1365,7 @@ setup_libs(void) {
|
|||
if (!have_ipv6 && !have_ipv4)
|
||||
fatal("can't find either v4 or v6 networking");
|
||||
|
||||
result = isc_mem_create(0, 0, &mctx);
|
||||
check_result(result, "isc_mem_create");
|
||||
isc_mem_create(&mctx);
|
||||
isc_mem_setname(mctx, "dig", NULL);
|
||||
|
||||
result = isc_log_create(mctx, &lctx, &logconfig);
|
||||
|
|
|
|||
|
|
@ -1074,10 +1074,7 @@ main(int argc, char *argv[]) {
|
|||
int ch;
|
||||
char *endp;
|
||||
|
||||
result = isc_mem_create(0, 0, &mctx);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
fatal("out of memory");
|
||||
}
|
||||
isc_mem_create(&mctx);
|
||||
|
||||
#if USE_PKCS11
|
||||
pk11_result_register();
|
||||
|
|
|
|||
|
|
@ -350,10 +350,7 @@ main(int argc, char **argv) {
|
|||
usage();
|
||||
}
|
||||
|
||||
result = isc_mem_create(0, 0, &mctx);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
fatal("out of memory");
|
||||
}
|
||||
isc_mem_create(&mctx);
|
||||
|
||||
#if USE_PKCS11
|
||||
pk11_result_register();
|
||||
|
|
|
|||
|
|
@ -300,9 +300,7 @@ main(int argc, char **argv) {
|
|||
if (argc == 1)
|
||||
usage();
|
||||
|
||||
result = isc_mem_create(0, 0, &mctx);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
fatal("out of memory");
|
||||
isc_mem_create(&mctx);
|
||||
|
||||
#if USE_PKCS11
|
||||
pk11_result_register();
|
||||
|
|
|
|||
|
|
@ -163,7 +163,7 @@ main(int argc, char **argv) {
|
|||
if (argc == 1)
|
||||
usage();
|
||||
|
||||
RUNTIME_CHECK(isc_mem_create(0, 0, &mctx) == ISC_R_SUCCESS);
|
||||
isc_mem_create(&mctx);
|
||||
|
||||
#if USE_PKCS11
|
||||
pk11_result_register();
|
||||
|
|
|
|||
|
|
@ -259,7 +259,7 @@ main(int argc, char **argv) {
|
|||
}
|
||||
isc_commandline_reset = true;
|
||||
|
||||
RUNTIME_CHECK(isc_mem_create(0, 0, &mctx) == ISC_R_SUCCESS);
|
||||
isc_mem_create(&mctx);
|
||||
|
||||
isc_stdtime_get(&now);
|
||||
|
||||
|
|
|
|||
|
|
@ -88,9 +88,7 @@ main(int argc, char **argv) {
|
|||
if (argc == 1)
|
||||
usage();
|
||||
|
||||
result = isc_mem_create(0, 0, &mctx);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
fatal("Out of memory");
|
||||
isc_mem_create(&mctx);
|
||||
|
||||
#if HAVE_PKCS11
|
||||
pk11_result_register();
|
||||
|
|
|
|||
|
|
@ -167,9 +167,7 @@ main(int argc, char **argv) {
|
|||
if (argc == 1)
|
||||
usage();
|
||||
|
||||
result = isc_mem_create(0, 0, &mctx);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
fatal("Out of memory");
|
||||
isc_mem_create(&mctx);
|
||||
|
||||
setup_logging(mctx, &log);
|
||||
|
||||
|
|
|
|||
|
|
@ -3230,9 +3230,7 @@ main(int argc, char *argv[]) {
|
|||
|
||||
check_result(isc_app_start(), "isc_app_start");
|
||||
|
||||
result = isc_mem_create(0, 0, &mctx);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
fatal("out of memory");
|
||||
isc_mem_create(&mctx);
|
||||
|
||||
#if USE_PKCS11
|
||||
pk11_result_register();
|
||||
|
|
|
|||
|
|
@ -209,9 +209,7 @@ main(int argc, char *argv[]) {
|
|||
isc_commandline_reset = true;
|
||||
check_result(isc_app_start(), "isc_app_start");
|
||||
|
||||
result = isc_mem_create(0, 0, &mctx);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
fatal("out of memory");
|
||||
isc_mem_create(&mctx);
|
||||
|
||||
#if USE_PKCS11
|
||||
pk11_result_register();
|
||||
|
|
|
|||
|
|
@ -1462,10 +1462,7 @@ main(int argc, char *argv[]) {
|
|||
named_g_chrootdir);
|
||||
}
|
||||
|
||||
result = isc_mem_create(0, 0, &named_g_mctx);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
named_main_earlyfatal("isc_mem_create() failed: %s",
|
||||
isc_result_totext(result));
|
||||
isc_mem_create(&named_g_mctx);
|
||||
isc_mem_setname(named_g_mctx, "main", NULL);
|
||||
|
||||
setup();
|
||||
|
|
|
|||
|
|
@ -4349,9 +4349,9 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist,
|
|||
* cache, for the main cache memory and the heap
|
||||
* memory.
|
||||
*/
|
||||
CHECK(isc_mem_create(0, 0, &cmctx));
|
||||
isc_mem_create(&cmctx);
|
||||
isc_mem_setname(cmctx, "cache", NULL);
|
||||
CHECK(isc_mem_create(0, 0, &hmctx));
|
||||
isc_mem_create(&hmctx);
|
||||
isc_mem_setname(hmctx, "cache_heap", NULL);
|
||||
CHECK(dns_cache_create(cmctx, hmctx, named_g_taskmgr,
|
||||
named_g_timermgr, view->rdclass,
|
||||
|
|
|
|||
|
|
@ -225,9 +225,7 @@ dlopen_dlz_create(const char *dlzname, unsigned int argc, char *argv[],
|
|||
return (ISC_R_FAILURE);
|
||||
}
|
||||
|
||||
result = isc_mem_create(0, 0, &mctx);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
return (result);
|
||||
isc_mem_create(&mctx);
|
||||
|
||||
cd = isc_mem_get(mctx, sizeof(*cd));
|
||||
memset(cd, 0, sizeof(*cd));
|
||||
|
|
|
|||
|
|
@ -224,7 +224,7 @@ dlopen_dlz_create(const char *dlzname, unsigned int argc, char *argv[],
|
|||
return (ISC_R_FAILURE);
|
||||
}
|
||||
|
||||
isc_mem_create(0, 0, &mctx);
|
||||
isc_mem_create(&mctx);
|
||||
|
||||
cd = isc_mem_get(mctx, sizeof(*cd));
|
||||
memset(cd, 0, sizeof(*cd));
|
||||
|
|
|
|||
|
|
@ -3269,8 +3269,7 @@ main(int argc, char **argv) {
|
|||
|
||||
pre_parse_args(argc, argv);
|
||||
|
||||
result = isc_mem_create(0, 0, &gmctx);
|
||||
check_result(result, "isc_mem_create");
|
||||
isc_mem_create(&gmctx);
|
||||
|
||||
parse_args(argc, argv);
|
||||
|
||||
|
|
|
|||
|
|
@ -65,10 +65,7 @@ main(int argc, char *argv[]) {
|
|||
exit(1);
|
||||
}
|
||||
|
||||
if (isc_mem_create(0, 0, &mctx) != ISC_R_SUCCESS) {
|
||||
fprintf(stderr, "isc_mem_create() failed\n");
|
||||
exit(1);
|
||||
}
|
||||
isc_mem_create(&mctx);
|
||||
|
||||
pk11_result_register();
|
||||
|
||||
|
|
|
|||
|
|
@ -930,7 +930,7 @@ main(int argc, char **argv) {
|
|||
|
||||
serial = isc_random32();
|
||||
|
||||
DO("create memory context", isc_mem_create(0, 0, &rndc_mctx));
|
||||
isc_mem_create(&rndc_mctx);
|
||||
DO("create socket manager", isc_socketmgr_create(rndc_mctx, &socketmgr));
|
||||
DO("create task manager", isc_taskmgr_create(rndc_mctx, 1, 0, &taskmgr));
|
||||
DO("create task", isc_task_create(taskmgr, 0, &task));
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ main(int argc, char **argv) {
|
|||
unsigned int zonetype = 0;
|
||||
unsigned int pflags = 0;
|
||||
|
||||
RUNTIME_CHECK(isc_mem_create(0, 0, &mctx) == ISC_R_SUCCESS);
|
||||
isc_mem_create(&mctx);
|
||||
|
||||
result = isc_log_create(mctx, &lctx, &lcfg);
|
||||
check_result(result, "isc_log_create()");
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ main(int argc, char **argv) {
|
|||
journal = argv[4];
|
||||
|
||||
isc_mem_debugging |= ISC_MEM_DEBUGRECORD;
|
||||
CHECK(isc_mem_create(0, 0, &mctx));
|
||||
isc_mem_create(&mctx);
|
||||
|
||||
CHECK(dst_lib_init(mctx, NULL));
|
||||
dst_active = true;
|
||||
|
|
|
|||
|
|
@ -295,7 +295,7 @@ main(int argc, char **argv) {
|
|||
/*
|
||||
* EVERYTHING needs a memory context.
|
||||
*/
|
||||
RUNTIME_CHECK(isc_mem_create(0, 0, &mctx) == ISC_R_SUCCESS);
|
||||
isc_mem_create(&mctx);
|
||||
|
||||
cmp = NULL;
|
||||
RUNTIME_CHECK(isc_mempool_create(mctx, sizeof(client_t), &cmp)
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ main(int argc, char *argv[]) {
|
|||
dns_result_register();
|
||||
|
||||
mctx = NULL;
|
||||
RUNTIME_CHECK(isc_mem_create(0, 0, &mctx) == ISC_R_SUCCESS);
|
||||
isc_mem_create(&mctx);
|
||||
|
||||
while ((ch = isc_commandline_parse(argc, argv, "nvw:")) != -1) {
|
||||
switch (ch) {
|
||||
|
|
|
|||
|
|
@ -201,7 +201,7 @@ main(int argc, char *argv[]) {
|
|||
dns_result_register();
|
||||
|
||||
mctx = NULL;
|
||||
RUNTIME_CHECK(isc_mem_create(0, 0, &mctx) == ISC_R_SUCCESS);
|
||||
isc_mem_create(&mctx);
|
||||
|
||||
while ((ch = isc_commandline_parse(argc, argv, "d:vw:")) != -1) {
|
||||
switch (ch) {
|
||||
|
|
|
|||
|
|
@ -362,7 +362,7 @@ main(int argc, char *argv[]) {
|
|||
|
||||
dns_result_register();
|
||||
|
||||
RUNTIME_CHECK(isc_mem_create(0, 0, &mctx) == ISC_R_SUCCESS);
|
||||
isc_mem_create(&mctx);
|
||||
RUNTIME_CHECK(dns_dbtable_create(mctx, dns_rdataclass_in, &dbtable) ==
|
||||
ISC_R_SUCCESS);
|
||||
|
||||
|
|
|
|||
|
|
@ -445,7 +445,7 @@ main(int argc, char *argv[]) {
|
|||
dns_result_register();
|
||||
|
||||
mctx = NULL;
|
||||
RUNCHECK(isc_mem_create(0, 0, &mctx));
|
||||
isc_mem_create(&mctx);
|
||||
|
||||
RUNCHECK(isc_log_create(mctx, &lctx, &lcfg));
|
||||
isc_log_setcontext(lctx);
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ main(int argc, char **argv) {
|
|||
UNUSED(argc);
|
||||
UNUSED(argv);
|
||||
|
||||
RUNTIME_CHECK(isc_mem_create(0, 0, &mctx) == ISC_R_SUCCESS);
|
||||
isc_mem_create(&mctx);
|
||||
result = isc_interfaceiter_create(mctx, &iter);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
goto cleanup;
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ main(int argc, char *argv[]) {
|
|||
}
|
||||
}
|
||||
|
||||
RUNTIME_CHECK(isc_mem_create(0, 0, &mctx) == ISC_R_SUCCESS);
|
||||
isc_mem_create(&mctx);
|
||||
RUNTIME_CHECK(isc_lex_create(mctx, 256, &lex) == ISC_R_SUCCESS);
|
||||
|
||||
if (masterfile) {
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ main(int argc, char **argv) {
|
|||
lctx = NULL;
|
||||
lcfg = NULL;
|
||||
|
||||
CHECK(isc_mem_create(0, 0, &mctx));
|
||||
isc_mem_create(&mctx);
|
||||
CHECK(isc_log_create(mctx, &lctx, &lcfg));
|
||||
|
||||
CHECK(isc_log_settag(lcfg, progname));
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ main(int argc, char *argv[]) {
|
|||
|
||||
UNUSED(argc);
|
||||
|
||||
RUNTIME_CHECK(isc_mem_create(0, 0, &mctx) == ISC_R_SUCCESS);
|
||||
isc_mem_create(&mctx);
|
||||
|
||||
if (argv[1]) {
|
||||
isc_buffer_init(&source, argv[1], strlen(argv[1]));
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ main(int argc, char *argv[]) {
|
|||
isc_mutex_init(&lock);
|
||||
|
||||
mctx = NULL;
|
||||
RUNTIME_CHECK(isc_mem_create(0, 0, &mctx) == ISC_R_SUCCESS);
|
||||
isc_mem_create(&mctx);
|
||||
|
||||
mp1 = NULL;
|
||||
RUNTIME_CHECK(isc_mempool_create(mctx, 24, &mp1) == ISC_R_SUCCESS);
|
||||
|
|
|
|||
|
|
@ -186,12 +186,10 @@ nsecify(char *filename) {
|
|||
int
|
||||
main(int argc, char *argv[]) {
|
||||
int i;
|
||||
isc_result_t result;
|
||||
|
||||
dns_result_register();
|
||||
|
||||
result = isc_mem_create(0, 0, &mctx);
|
||||
check_result(result, "isc_mem_create()");
|
||||
isc_mem_create(&mctx);
|
||||
|
||||
argc--;
|
||||
argv++;
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ main(int argc, char *argv[]) {
|
|||
isc_app_start();
|
||||
isc_interval_set(&linterval, 1, 0);
|
||||
|
||||
RUNTIME_CHECK(isc_mem_create(0, 0, &mctx) == ISC_R_SUCCESS);
|
||||
isc_mem_create(&mctx);
|
||||
RUNTIME_CHECK(isc_taskmgr_create(mctx, 3, 0, &taskmgr) ==
|
||||
ISC_R_SUCCESS);
|
||||
RUNTIME_CHECK(isc_timermgr_create(mctx, &timermgr) ==
|
||||
|
|
|
|||
|
|
@ -277,12 +277,7 @@ main(int argc, char **argv) {
|
|||
*/
|
||||
isc_mem_debugging = ISC_MEM_DEBUGRECORD;
|
||||
|
||||
result = isc_mem_create(0, 0, &mctx);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
printf("isc_mem_create: %s: exiting\n",
|
||||
dns_result_totext(result));
|
||||
exit(1);
|
||||
}
|
||||
isc_mem_create(&mctx);
|
||||
|
||||
result = dns_rbt_create(mctx, delete_name, NULL, &rbt);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
|
|
|
|||
|
|
@ -178,9 +178,9 @@ main(int argc, char *argv[]) {
|
|||
printf("%u workers\n", workers);
|
||||
|
||||
mctx = NULL;
|
||||
RUNTIME_CHECK(isc_mem_create(0, 0, &mctx) == ISC_R_SUCCESS);
|
||||
isc_mem_create(&mctx);
|
||||
mctx2 = NULL;
|
||||
RUNTIME_CHECK(isc_mem_create(0, 0, &mctx2) == ISC_R_SUCCESS);
|
||||
isc_mem_create(&mctx2);
|
||||
RUNTIME_CHECK(isc_taskmgr_create(mctx, workers, 0, &task_manager) ==
|
||||
ISC_R_SUCCESS);
|
||||
RUNTIME_CHECK(isc_timermgr_create(mctx, &timer_manager) ==
|
||||
|
|
|
|||
|
|
@ -207,7 +207,7 @@ main(int argc, char *argv[]) {
|
|||
isc_mutex_init(&lock);
|
||||
|
||||
mctx = NULL;
|
||||
RUNTIME_CHECK(isc_mem_create(0, 0, &mctx) == ISC_R_SUCCESS);
|
||||
isc_mem_create(&mctx);
|
||||
|
||||
while ((ch = isc_commandline_parse(argc, argv, "vp:")) != -1) {
|
||||
switch (ch) {
|
||||
|
|
|
|||
|
|
@ -286,7 +286,7 @@ main(int argc, char *argv[]) {
|
|||
* EVERYTHING needs a memory context.
|
||||
*/
|
||||
mctx = NULL;
|
||||
RUNTIME_CHECK(isc_mem_create(0, 0, &mctx) == ISC_R_SUCCESS);
|
||||
isc_mem_create(&mctx);
|
||||
|
||||
/*
|
||||
* The task manager is independent (other than memory context)
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ main(int argc, char *argv[]) {
|
|||
}
|
||||
}
|
||||
|
||||
RUNTIME_CHECK(isc_mem_create(0, 0, &mctx) == ISC_R_SUCCESS);
|
||||
isc_mem_create(&mctx);
|
||||
RUNTIME_CHECK(isc_symtab_create(mctx, 691, undefine_action, NULL,
|
||||
case_sensitive, &st) == ISC_R_SUCCESS);
|
||||
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ main(int argc, char *argv[]) {
|
|||
workers = 2;
|
||||
printf("%u workers\n", workers);
|
||||
|
||||
RUNTIME_CHECK(isc_mem_create(0, 0, &mctx) == ISC_R_SUCCESS);
|
||||
isc_mem_create(&mctx);
|
||||
|
||||
RUNTIME_CHECK(isc_taskmgr_create(mctx, workers, 0, &manager) ==
|
||||
ISC_R_SUCCESS);
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ main(int argc, char *argv[]) {
|
|||
workers = 2;
|
||||
printf("%u workers\n", workers);
|
||||
|
||||
RUNTIME_CHECK(isc_mem_create(0, 0, &mctx1) == ISC_R_SUCCESS);
|
||||
isc_mem_create(&mctx1);
|
||||
RUNTIME_CHECK(isc_taskmgr_create(mctx1, workers, 0, &manager) ==
|
||||
ISC_R_SUCCESS);
|
||||
RUNTIME_CHECK(isc_timermgr_create(mctx1, &timgr) == ISC_R_SUCCESS);
|
||||
|
|
|
|||
|
|
@ -280,7 +280,7 @@ main(int argc, char **argv) {
|
|||
usage();
|
||||
|
||||
RUNTIME_CHECK(isc_app_start() == ISC_R_SUCCESS);
|
||||
RUNTIME_CHECK(isc_mem_create(0, 0, &mctx) == ISC_R_SUCCESS);
|
||||
isc_mem_create(&mctx);
|
||||
RUNTIME_CHECK(isc_taskmgr_create(mctx, 2, 0, &taskmgr) ==
|
||||
ISC_R_SUCCESS);
|
||||
RUNTIME_CHECK(isc_timermgr_create(mctx, &timermgr) == ISC_R_SUCCESS);
|
||||
|
|
|
|||
|
|
@ -268,7 +268,7 @@ main(int argc, char *argv[]) {
|
|||
isc_sockaddr_fromin(&dstaddr, &inaddr, port);
|
||||
|
||||
mctx = NULL;
|
||||
RUNCHECK(isc_mem_create(0, 0, &mctx));
|
||||
isc_mem_create(&mctx);
|
||||
|
||||
lctx = NULL;
|
||||
lcfg = NULL;
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ main(int argc, char **argv) {
|
|||
|
||||
dns_result_register();
|
||||
|
||||
CHECK(isc_mem_create(0, 0, &mctx), "isc_mem_create()");
|
||||
isc_mem_create(&mctx);
|
||||
CHECK(dst_lib_init(mctx, NULL), "dst_lib_init()");
|
||||
CHECK(isc_log_create(mctx, &log_, &logconfig), "isc_log_create()");
|
||||
isc_log_setcontext(log_);
|
||||
|
|
|
|||
|
|
@ -227,7 +227,7 @@ main(int argc, char *argv[]) {
|
|||
|
||||
mctx = NULL;
|
||||
isc_mem_debugging = ISC_MEM_DEBUGRECORD;
|
||||
RUNCHECK(isc_mem_create(0, 0, &mctx));
|
||||
isc_mem_create(&mctx);
|
||||
|
||||
log = NULL;
|
||||
logconfig = NULL;
|
||||
|
|
|
|||
|
|
@ -166,7 +166,7 @@ main(int argc, char **argv) {
|
|||
dns_result_register();
|
||||
|
||||
mctx = NULL;
|
||||
RUNCHECK(isc_mem_create(0, 0, &mctx));
|
||||
isc_mem_create(&mctx);
|
||||
|
||||
log = NULL;
|
||||
logconfig = NULL;
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@ main(int argc, char *argv[]) {
|
|||
}
|
||||
isc_commandline_reset = true;
|
||||
|
||||
RUNTIME_CHECK(isc_mem_create(0, 0, &mctx) == ISC_R_SUCCESS);
|
||||
isc_mem_create(&mctx);
|
||||
|
||||
while ((ch = isc_commandline_parse(argc, argv, CMDLINE_FLAGS)) != -1) {
|
||||
switch (ch) {
|
||||
|
|
|
|||
|
|
@ -342,7 +342,7 @@ main(int argc, char *argv[]) {
|
|||
if (argc < 1)
|
||||
fatal("no file specified");
|
||||
|
||||
RUNTIME_CHECK(isc_mem_create(0, 0, &mctx) == ISC_R_SUCCESS);
|
||||
isc_mem_create(&mctx);
|
||||
|
||||
dns_result_register();
|
||||
|
||||
|
|
|
|||
|
|
@ -2015,7 +2015,7 @@ main(int argc, char *argv[]) {
|
|||
preparse_args(argc, argv);
|
||||
|
||||
mctx = NULL;
|
||||
RUNCHECK(isc_mem_create(0, 0, &mctx));
|
||||
isc_mem_create(&mctx);
|
||||
|
||||
lctx = NULL;
|
||||
lcfg = NULL;
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ main(int argc, char **argv) {
|
|||
|
||||
file = argv[1];
|
||||
|
||||
RUNTIME_CHECK(isc_mem_create(0, 0, &mctx) == ISC_R_SUCCESS);
|
||||
isc_mem_create(&mctx);
|
||||
RUNTIME_CHECK(setup_logging(mctx, stderr, &lctx) == ISC_R_SUCCESS);
|
||||
|
||||
result = dns_journal_print(mctx, file, stdout);
|
||||
|
|
|
|||
|
|
@ -146,7 +146,7 @@ main(int argc, char *argv[]) {
|
|||
if (doexit)
|
||||
exit(0);
|
||||
|
||||
RUNTIME_CHECK(isc_mem_create(0, 0, &mctx) == ISC_R_SUCCESS);
|
||||
isc_mem_create(&mctx);
|
||||
RUNTIME_CHECK(isc_lex_create(mctx, 256, &lex) == ISC_R_SUCCESS);
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -668,11 +668,7 @@ open_lexer(void) {
|
|||
return ISC_R_SUCCESS;
|
||||
|
||||
/* allocate memory for lexer, and verify it was allocated */
|
||||
result = isc_mem_create(0, 0, &lex_mctx);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
fprintf(stderr, "unexpected error creating lexer\n");
|
||||
return result;
|
||||
}
|
||||
isc_mem_create(&lex_mctx);
|
||||
|
||||
/* create lexer */
|
||||
result = isc_lex_create(lex_mctx, 1500, &lexer);
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
|
|||
rdtype = typelist[(*data++) % types]; size--;
|
||||
rdclass = classlist[(*data++) % classes]; size--;
|
||||
|
||||
CHECK(isc_mem_create(0, 0, &mctx));
|
||||
isc_mem_create(&mctx);
|
||||
|
||||
CHECK(isc_lex_create(mctx, 64, &lex));
|
||||
memset(specials, 0, sizeof(specials));
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size);
|
|||
static isc_mem_t *mctx = NULL;
|
||||
|
||||
static void __attribute__((constructor)) init(void) {
|
||||
RUNTIME_CHECK(isc_mem_create(0, 0, &mctx) == ISC_R_SUCCESS);
|
||||
isc_mem_create(&mctx);
|
||||
RUNTIME_CHECK(dst_lib_init(mctx, NULL) == ISC_R_SUCCESS);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -413,9 +413,7 @@ dns_client_create(dns_client_t **clientp, unsigned int options) {
|
|||
unsigned int logdebuglevel = 0;
|
||||
#endif
|
||||
|
||||
result = isc_mem_create(0, 0, &mctx);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
return (result);
|
||||
isc_mem_create(&mctx);
|
||||
result = isc_appctx_create(mctx, &actx);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
goto cleanup;
|
||||
|
|
|
|||
|
|
@ -164,10 +164,9 @@ dt_init(void) {
|
|||
if (!dt_initialized) {
|
||||
int ret;
|
||||
|
||||
if (dt_mctx == NULL)
|
||||
result = isc_mem_create(0, 0, &dt_mctx);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
goto unlock;
|
||||
if (dt_mctx == NULL) {
|
||||
isc_mem_create(&dt_mctx);
|
||||
}
|
||||
isc_mem_setname(dt_mctx, "dt", NULL);
|
||||
isc_mem_setdestroycheck(dt_mctx, false);
|
||||
|
||||
|
|
@ -177,7 +176,6 @@ dt_init(void) {
|
|||
else
|
||||
result = ISC_R_FAILURE;
|
||||
}
|
||||
unlock:
|
||||
UNLOCK(&dt_mutex);
|
||||
|
||||
return (result);
|
||||
|
|
|
|||
|
|
@ -108,10 +108,7 @@ state_key_init(void) {
|
|||
int ret;
|
||||
|
||||
if (state_mctx == NULL) {
|
||||
result = isc_mem_create(0, 0, &state_mctx);
|
||||
}
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
goto unlock;
|
||||
isc_mem_create(&state_mctx);
|
||||
}
|
||||
isc_mem_setname(state_mctx, "geoip_state", NULL);
|
||||
isc_mem_setdestroycheck(state_mctx, false);
|
||||
|
|
@ -123,7 +120,6 @@ state_key_init(void) {
|
|||
result = ISC_R_FAILURE;
|
||||
}
|
||||
}
|
||||
unlock:
|
||||
UNLOCK(&key_mutex);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -54,9 +54,7 @@ initialize(void) {
|
|||
|
||||
isc_refcount_init(&references, 0);
|
||||
|
||||
result = isc_mem_create(0, 0, &dns_g_mctx);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
return;
|
||||
isc_mem_create(&dns_g_mctx);
|
||||
dns_result_register();
|
||||
result = dns_ecdb_register(dns_g_mctx, &dbimp);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
|
|
|
|||
|
|
@ -1299,10 +1299,9 @@ totext_filter_proc_key_init(void) {
|
|||
|
||||
if (!thread_key_initialized) {
|
||||
LOCK(&thread_key_mutex);
|
||||
if (thread_key_mctx == NULL)
|
||||
result = isc_mem_create(0, 0, &thread_key_mctx);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
goto unlock;
|
||||
if (thread_key_mctx == NULL) {
|
||||
isc_mem_create(&thread_key_mctx);
|
||||
}
|
||||
isc_mem_setname(thread_key_mctx, "threadkey", NULL);
|
||||
isc_mem_setdestroycheck(thread_key_mctx, false);
|
||||
|
||||
|
|
@ -1311,9 +1310,9 @@ totext_filter_proc_key_init(void) {
|
|||
free_specific) != 0) {
|
||||
result = ISC_R_FAILURE;
|
||||
isc_mem_detach(&thread_key_mctx);
|
||||
} else
|
||||
} else {
|
||||
thread_key_initialized = 1;
|
||||
unlock:
|
||||
}
|
||||
UNLOCK(&thread_key_mutex);
|
||||
}
|
||||
return (result);
|
||||
|
|
|
|||
|
|
@ -9977,12 +9977,7 @@ dns_resolver_create(dns_view_t *view,
|
|||
* contention among multiple threads. Do this only when
|
||||
* enabling threads because it will be require more memory.
|
||||
*/
|
||||
result = isc_mem_create(0, 0, &res->buckets[i].mctx);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
isc_task_detach(&res->buckets[i].task);
|
||||
isc_mutex_destroy(&res->buckets[i].lock);
|
||||
goto cleanup_buckets;
|
||||
}
|
||||
isc_mem_create(&res->buckets[i].mctx);
|
||||
isc_mem_setname(res->buckets[i].mctx, name, NULL);
|
||||
isc_task_setname(res->buckets[i].task, name, res);
|
||||
ISC_LIST_INIT(res->buckets[i].fctxs);
|
||||
|
|
|
|||
|
|
@ -69,8 +69,7 @@ getoriginnode_test(void **state) {
|
|||
|
||||
UNUSED(state);
|
||||
|
||||
result = isc_mem_create(0, 0, &mctx);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
isc_mem_create(&mctx);
|
||||
|
||||
result = dns_db_create(mctx, "rbt", dns_rootname, dns_dbtype_zone,
|
||||
dns_rdataclass_in, 0, NULL, &db);
|
||||
|
|
@ -98,8 +97,7 @@ getsetservestalettl_test(void **state) {
|
|||
|
||||
UNUSED(state);
|
||||
|
||||
result = isc_mem_create(0, 0, &mctx);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
isc_mem_create(&mctx);
|
||||
|
||||
result = dns_db_create(mctx, "rbt", dns_rootname, dns_dbtype_cache,
|
||||
dns_rdataclass_in, 0, NULL, &db);
|
||||
|
|
@ -142,8 +140,7 @@ dns_dbfind_staleok_test(void **state) {
|
|||
|
||||
UNUSED(state);
|
||||
|
||||
result = isc_mem_create(0, 0, &mctx);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
isc_mem_create(&mctx);
|
||||
|
||||
result = dns_db_create(mctx, "rbt", dns_rootname, dns_dbtype_cache,
|
||||
dns_rdataclass_in, 0, NULL, &db);
|
||||
|
|
|
|||
|
|
@ -142,7 +142,7 @@ dns_test_begin(FILE *logfile, bool start_managers) {
|
|||
}
|
||||
|
||||
INSIST(dt_mctx == NULL);
|
||||
CHECK(isc_mem_create(0, 0, &dt_mctx));
|
||||
isc_mem_create(&dt_mctx);
|
||||
|
||||
/* Don't check the memory leaks as they hide the assertions */
|
||||
isc_mem_setdestroycheck(dt_mctx, false);
|
||||
|
|
|
|||
|
|
@ -778,11 +778,7 @@ dns_view_createresolver(dns_view_t *view,
|
|||
view->attributes &= ~DNS_VIEWATTR_RESSHUTDOWN;
|
||||
isc_refcount_increment(&view->weakrefs);
|
||||
|
||||
result = isc_mem_create(0, 0, &mctx);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
dns_resolver_shutdown(view->resolver);
|
||||
return (result);
|
||||
}
|
||||
isc_mem_create(&mctx);
|
||||
|
||||
result = dns_adb_create(mctx, view, timermgr, taskmgr, &view->adb);
|
||||
isc_mem_setname(mctx, "ADB", NULL);
|
||||
|
|
|
|||
|
|
@ -16775,16 +16775,13 @@ dns_zonemgr_shutdown(dns_zonemgr_t *zmgr) {
|
|||
|
||||
static isc_result_t
|
||||
mctxinit(void **target, void *arg) {
|
||||
isc_result_t result;
|
||||
isc_mem_t *mctx = NULL;
|
||||
|
||||
UNUSED(arg);
|
||||
|
||||
REQUIRE(target != NULL && *target == NULL);
|
||||
|
||||
result = isc_mem_create(0, 0, &mctx);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
return (result);
|
||||
isc_mem_create(&mctx);
|
||||
isc_mem_setname(mctx, "zonemgr-pool", NULL);
|
||||
|
||||
*target = mctx;
|
||||
|
|
|
|||
|
|
@ -93,9 +93,7 @@ ctxs_init(isc_mem_t **mctxp, isc_appctx_t **actxp,
|
|||
{
|
||||
isc_result_t result;
|
||||
|
||||
result = isc_mem_create(0, 0, mctxp);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
goto fail;
|
||||
isc_mem_create(mctxp);
|
||||
|
||||
result = isc_appctx_create(*mctxp, actxp);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
|
|
|
|||
|
|
@ -34,10 +34,7 @@ static isc_mem_t *mctx = NULL;
|
|||
|
||||
static void
|
||||
setup_test() {
|
||||
isc_result_t result;
|
||||
|
||||
result = isc_mem_create(0, 0, &mctx);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
isc_mem_create(&mctx);
|
||||
|
||||
/*
|
||||
* the caller might run from another directory, but tests
|
||||
|
|
|
|||
|
|
@ -58,8 +58,7 @@ isc_heap_delete_test(void **state) {
|
|||
|
||||
UNUSED(state);
|
||||
|
||||
result = isc_mem_create(0, 0, &mctx);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
isc_mem_create(&mctx);
|
||||
|
||||
result = isc_heap_create(mctx, compare, idx, 0, &heap);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
|
|
|
|||
|
|
@ -53,9 +53,8 @@ test_ht_full(int bits, uintptr_t count) {
|
|||
isc_mem_t *mctx = NULL;
|
||||
uintptr_t i;
|
||||
|
||||
result = isc_mem_createx(0, 0, default_memalloc, default_memfree,
|
||||
NULL, &mctx, 0);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
isc_mem_createx(default_memalloc, default_memfree,
|
||||
NULL, &mctx, 0);
|
||||
|
||||
result = isc_ht_init(&ht, mctx, bits);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
|
|
@ -207,9 +206,8 @@ test_ht_iterator() {
|
|||
unsigned char key[16];
|
||||
size_t tksize;
|
||||
|
||||
result = isc_mem_createx(0, 0, default_memalloc, default_memfree,
|
||||
NULL, &mctx, 0);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
isc_mem_createx(default_memalloc, default_memfree,
|
||||
NULL, &mctx, 0);
|
||||
|
||||
result = isc_ht_init(&ht, mctx, 16);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ isc_test_begin(FILE *logfile, bool start_managers,
|
|||
isc_mem_debugging |= ISC_MEM_DEBUGRECORD;
|
||||
|
||||
INSIST(mctx == NULL);
|
||||
CHECK(isc_mem_create(0, 0, &mctx));
|
||||
isc_mem_create(&mctx);
|
||||
|
||||
if (logfile != NULL) {
|
||||
isc_logdestination_t destination;
|
||||
|
|
|
|||
|
|
@ -41,8 +41,7 @@ lex_0xff(void **state) {
|
|||
|
||||
UNUSED(state);
|
||||
|
||||
result = isc_mem_create(0, 0, &mctx);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
isc_mem_create(&mctx);
|
||||
|
||||
result = isc_lex_create(mctx, 1024, &lex);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
|
|
@ -75,8 +74,7 @@ lex_setline(void **state) {
|
|||
|
||||
UNUSED(state);
|
||||
|
||||
result = isc_mem_create(0, 0, &mctx);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
isc_mem_create(&mctx);
|
||||
|
||||
result = isc_lex_create(mctx, 1024, &lex);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
|
|
|
|||
|
|
@ -95,8 +95,7 @@ isc_mem_test(void **state) {
|
|||
|
||||
UNUSED(state);
|
||||
|
||||
result = isc_mem_create(0, 0, &localmctx);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
isc_mem_create(&localmctx);
|
||||
|
||||
result = isc_mempool_create(localmctx, 24, &mp1);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
|
|
@ -169,10 +168,9 @@ isc_mem_test(void **state) {
|
|||
|
||||
isc_mem_destroy(&localmctx);
|
||||
|
||||
result = isc_mem_createx(0, 0, default_memalloc, default_memfree,
|
||||
NULL, &localmctx,
|
||||
ISC_MEMFLAG_FILL | ISC_MEMFLAG_INTERNAL);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
isc_mem_createx(default_memalloc, default_memfree,
|
||||
NULL, &localmctx,
|
||||
ISC_MEMFLAG_FILL | ISC_MEMFLAG_INTERNAL);
|
||||
|
||||
result = isc_mempool_create(localmctx, 2, &mp1);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
|
|
@ -191,7 +189,6 @@ isc_mem_test(void **state) {
|
|||
/* test TotalUse calculation */
|
||||
static void
|
||||
isc_mem_total_test(void **state) {
|
||||
isc_result_t result;
|
||||
isc_mem_t *mctx2 = NULL;
|
||||
size_t before, after;
|
||||
ssize_t diff;
|
||||
|
|
@ -201,11 +198,8 @@ isc_mem_total_test(void **state) {
|
|||
|
||||
/* Local alloc, free */
|
||||
mctx2 = NULL;
|
||||
result = isc_mem_createx(0, 0, default_memalloc, default_memfree,
|
||||
isc_mem_createx(default_memalloc, default_memfree,
|
||||
NULL, &mctx2, 0);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
goto out;
|
||||
}
|
||||
|
||||
before = isc_mem_total(mctx2);
|
||||
|
||||
|
|
@ -239,17 +233,12 @@ isc_mem_total_test(void **state) {
|
|||
/* 2048 +8 bytes extra for size_info */
|
||||
assert_int_equal(diff, (2048 + 8) * 100000);
|
||||
|
||||
out:
|
||||
if (mctx2 != NULL) {
|
||||
isc_mem_destroy(&mctx2);
|
||||
}
|
||||
|
||||
isc_mem_destroy(&mctx2);
|
||||
}
|
||||
|
||||
/* test InUse calculation */
|
||||
static void
|
||||
isc_mem_inuse_test(void **state) {
|
||||
isc_result_t result;
|
||||
isc_mem_t *mctx2 = NULL;
|
||||
size_t before, after;
|
||||
ssize_t diff;
|
||||
|
|
@ -258,11 +247,8 @@ isc_mem_inuse_test(void **state) {
|
|||
UNUSED(state);
|
||||
|
||||
mctx2 = NULL;
|
||||
result = isc_mem_createx(0, 0, default_memalloc, default_memfree,
|
||||
NULL, &mctx2, 0);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
goto out;
|
||||
}
|
||||
isc_mem_createx(default_memalloc, default_memfree,
|
||||
NULL, &mctx2, 0);
|
||||
|
||||
before = isc_mem_inuse(mctx2);
|
||||
ptr = isc_mem_allocate(mctx2, 1024000);
|
||||
|
|
@ -273,11 +259,7 @@ isc_mem_inuse_test(void **state) {
|
|||
|
||||
assert_int_equal(diff, 0);
|
||||
|
||||
out:
|
||||
if (mctx2 != NULL) {
|
||||
isc_mem_destroy(&mctx2);
|
||||
}
|
||||
|
||||
isc_mem_destroy(&mctx2);
|
||||
}
|
||||
|
||||
#if ISC_MEM_TRACKLINES
|
||||
|
|
@ -296,9 +278,8 @@ isc_mem_noflags_test(void **state) {
|
|||
|
||||
UNUSED(state);
|
||||
|
||||
result = isc_mem_createx(0, 0, default_memalloc, default_memfree,
|
||||
NULL, &mctx2, 0);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
isc_mem_createx(default_memalloc, default_memfree,
|
||||
NULL, &mctx2, 0);
|
||||
isc_mem_debugging = 0;
|
||||
ptr = isc_mem_get(mctx2, 2048);
|
||||
assert_non_null(ptr);
|
||||
|
|
@ -343,9 +324,8 @@ isc_mem_recordflag_test(void **state) {
|
|||
|
||||
UNUSED(state);
|
||||
|
||||
result = isc_mem_createx(0, 0, default_memalloc, default_memfree,
|
||||
NULL, &mctx2, 0);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
isc_mem_createx(default_memalloc, default_memfree,
|
||||
NULL, &mctx2, 0);
|
||||
ptr = isc_mem_get(mctx2, 2048);
|
||||
assert_non_null(ptr);
|
||||
isc__mem_printactive(mctx2, f);
|
||||
|
|
@ -388,10 +368,9 @@ isc_mem_traceflag_test(void **state) {
|
|||
|
||||
UNUSED(state);
|
||||
|
||||
result = isc_mem_createx(0, 0, default_memalloc, default_memfree,
|
||||
NULL, &mctx2, 0);
|
||||
isc_mem_createx(default_memalloc, default_memfree,
|
||||
NULL, &mctx2, 0);
|
||||
isc_mem_debugging = ISC_MEM_DEBUGTRACE;
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
ptr = isc_mem_get(mctx2, 2048);
|
||||
assert_non_null(ptr);
|
||||
isc__mem_printactive(mctx2, f);
|
||||
|
|
|
|||
|
|
@ -273,7 +273,6 @@ matrix_binaryrank(uint32_t *bits, size_t rows, size_t cols) {
|
|||
static void
|
||||
random_test(pvalue_func_t *func, isc_random_func test_func) {
|
||||
isc_mem_t *mctx = NULL;
|
||||
isc_result_t result;
|
||||
uint32_t m;
|
||||
uint32_t j;
|
||||
uint32_t histogram[11] = { 0 };
|
||||
|
|
@ -287,8 +286,7 @@ random_test(pvalue_func_t *func, isc_random_func test_func) {
|
|||
|
||||
tables_init();
|
||||
|
||||
result = isc_mem_create(0, 0, &mctx);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
isc_mem_create(&mctx);
|
||||
|
||||
m = 1000;
|
||||
passed = 0;
|
||||
|
|
|
|||
|
|
@ -708,8 +708,7 @@ manytasks(void **state) {
|
|||
isc_condition_init(&cv);
|
||||
|
||||
isc_mem_debugging = ISC_MEM_DEBUGRECORD;
|
||||
result = isc_mem_create(0, 0, &mctx);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
isc_mem_create(&mctx);
|
||||
|
||||
result = isc_taskmgr_create(mctx, 4, 0, &taskmgr);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ setup() {
|
|||
isc_result_t result;
|
||||
|
||||
isc_mem_debugging |= ISC_MEM_DEBUGRECORD;
|
||||
CHECK(isc_mem_create(0, 0, &mctx));
|
||||
isc_mem_create(&mctx);
|
||||
|
||||
isc_logdestination_t destination;
|
||||
isc_logconfig_t *logconfig = NULL;
|
||||
|
|
|
|||
|
|
@ -3043,7 +3043,6 @@ client_timeout(isc_task_t *task, isc_event_t *event) {
|
|||
static isc_result_t
|
||||
get_clientmctx(ns_clientmgr_t *manager, isc_mem_t **mctxp) {
|
||||
isc_mem_t *clientmctx;
|
||||
isc_result_t result;
|
||||
#if NMCTXS > 0
|
||||
unsigned int nextmctx;
|
||||
#endif
|
||||
|
|
@ -3054,10 +3053,9 @@ get_clientmctx(ns_clientmgr_t *manager, isc_mem_t **mctxp) {
|
|||
* Caller must be holding the manager lock.
|
||||
*/
|
||||
if ((manager->sctx->options & NS_SERVER_CLIENTTEST) != 0) {
|
||||
result = isc_mem_create(0, 0, mctxp);
|
||||
if (result == ISC_R_SUCCESS)
|
||||
isc_mem_setname(*mctxp, "client", NULL);
|
||||
return (result);
|
||||
isc_mem_create(mctxp);
|
||||
isc_mem_setname(*mctxp, "client", NULL);
|
||||
return (ISC_R_SUCCESS);
|
||||
}
|
||||
#if NMCTXS > 0
|
||||
nextmctx = manager->nextmctx++;
|
||||
|
|
@ -3068,9 +3066,7 @@ get_clientmctx(ns_clientmgr_t *manager, isc_mem_t **mctxp) {
|
|||
|
||||
clientmctx = manager->mctxpool[nextmctx];
|
||||
if (clientmctx == NULL) {
|
||||
result = isc_mem_create(0, 0, &clientmctx);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
return (result);
|
||||
isc_mem_create(&clientmctx);
|
||||
isc_mem_setname(clientmctx, "client", NULL);
|
||||
|
||||
manager->mctxpool[nextmctx] = clientmctx;
|
||||
|
|
|
|||
|
|
@ -43,13 +43,9 @@ static isc_refcount_t references;
|
|||
|
||||
static void
|
||||
initialize(void) {
|
||||
isc_result_t result;
|
||||
|
||||
REQUIRE(initialize_done == false);
|
||||
|
||||
result = isc_mem_create(0, 0, &ns_g_mctx);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
return;
|
||||
isc_mem_create(&ns_g_mctx);
|
||||
|
||||
isc_refcount_init(&references, 0);
|
||||
initialize_done = true;
|
||||
|
|
|
|||
|
|
@ -237,7 +237,7 @@ ns_test_begin(FILE *logfile, bool start_managers) {
|
|||
}
|
||||
|
||||
INSIST(mctx == NULL);
|
||||
CHECK(isc_mem_create(0, 0, &mctx));
|
||||
isc_mem_create(&mctx);
|
||||
|
||||
if (!dst_active) {
|
||||
CHECK(dst_lib_init(mctx, NULL));
|
||||
|
|
|
|||
|
|
@ -215,9 +215,7 @@ ctxs_init(isc_mem_t **mctxp, isc_appctx_t **actxp,
|
|||
{
|
||||
isc_result_t result;
|
||||
|
||||
result = isc_mem_create(0, 0, mctxp);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
goto fail;
|
||||
isc_mem_create(mctxp);
|
||||
|
||||
result = isc_appctx_create(*mctxp, actxp);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
|
|
|
|||
|
|
@ -113,11 +113,7 @@ set_key(dns_client_t *client, char *keynamestr, char *keystr,
|
|||
isc_region_t r;
|
||||
dns_secalg_t alg;
|
||||
|
||||
result = isc_mem_create(0, 0, mctxp);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
fprintf(stderr, "failed to create mctx\n");
|
||||
exit(1);
|
||||
}
|
||||
isc_mem_create(mctxp);
|
||||
|
||||
if (algname != NULL) {
|
||||
tr.base = algname;
|
||||
|
|
@ -367,11 +363,7 @@ main(int argc, char *argv[]) {
|
|||
exit(1);
|
||||
}
|
||||
|
||||
result = isc_mem_create(0, 0, &mctx);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
fprintf(stderr, "failed to crate mctx\n");
|
||||
exit(1);
|
||||
}
|
||||
isc_mem_create(&mctx);
|
||||
|
||||
result = isc_appctx_create(mctx, &actx);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
|
|
|
|||
|
|
@ -97,9 +97,7 @@ ctxs_init(isc_mem_t **mctxp, isc_appctx_t **actxp,
|
|||
{
|
||||
isc_result_t result;
|
||||
|
||||
result = isc_mem_create(0, 0, mctxp);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
goto fail;
|
||||
isc_mem_create(mctxp);
|
||||
|
||||
result = isc_appctx_create(*mctxp, actxp);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
|
|
|
|||
|
|
@ -188,11 +188,7 @@ main(int argc, char *argv[]) {
|
|||
qmessage = NULL;
|
||||
rmessage = NULL;
|
||||
|
||||
result = isc_mem_create(0, 0, &mctx);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
fprintf(stderr, "failed to create a memory context\n");
|
||||
exit(1);
|
||||
}
|
||||
isc_mem_create(&mctx);
|
||||
result = dns_message_create(mctx, DNS_MESSAGE_INTENTRENDER, &qmessage);
|
||||
if (result == ISC_R_SUCCESS) {
|
||||
result = dns_message_create(mctx, DNS_MESSAGE_INTENTPARSE,
|
||||
|
|
|
|||
|
|
@ -240,11 +240,7 @@ main(int argc, char *argv[]) {
|
|||
fprintf(stderr, "dns_lib_init failed: %u\n", result);
|
||||
exit(1);
|
||||
}
|
||||
result = isc_mem_create(0, 0, &umctx);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
fprintf(stderr, "failed to crate mctx\n");
|
||||
exit(1);
|
||||
}
|
||||
isc_mem_create(&umctx);
|
||||
|
||||
result = dns_client_create(&client, 0);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue