0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * Copyright (C) 2015, 2016 Internet Systems Consortium, Inc. ("ISC")
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * This Source Code Form is subject to the terms of the Mozilla Public
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * License, v. 2.0. If a copy of the MPL was not distributed with this
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * file, You can obtain one at http://mozilla.org/MPL/2.0/.
84ee90b52d4fb443c796f4e1481f98d5a95b5614Evan Huntstatic void *
84ee90b52d4fb443c796f4e1481f98d5a95b5614Evan Hunt atf_tc_set_md_var(tc, "descr", "test TotalUse calculation");
84ee90b52d4fb443c796f4e1481f98d5a95b5614Evan Hunt /* Local alloc, free */
84ee90b52d4fb443c796f4e1481f98d5a95b5614Evan Hunt result = isc_mem_createx2(0, 0, default_memalloc, default_memfree,
84ee90b52d4fb443c796f4e1481f98d5a95b5614Evan Hunt for (i = 0; i < 100000; i++) {
84ee90b52d4fb443c796f4e1481f98d5a95b5614Evan Hunt printf("total_before=%lu, total_after=%lu, total_diff=%lu\n",
d2a50c9ba87a6c57cb310308dfe95fff2f2836e2Mark Andrews (unsigned long)diff);
84ee90b52d4fb443c796f4e1481f98d5a95b5614Evan Hunt /* 2048 +8 bytes extra for size_info */
84ee90b52d4fb443c796f4e1481f98d5a95b5614Evan Hunt /* ISC_MEMFLAG_INTERNAL */
84ee90b52d4fb443c796f4e1481f98d5a95b5614Evan Hunt for (i = 0; i < 100000; i++) {
84ee90b52d4fb443c796f4e1481f98d5a95b5614Evan Hunt printf("total_before=%lu, total_after=%lu, total_diff=%lu\n",
d2a50c9ba87a6c57cb310308dfe95fff2f2836e2Mark Andrews (unsigned long)diff);
84ee90b52d4fb443c796f4e1481f98d5a95b5614Evan Hunt /* 2048 +8 bytes extra for size_info */
84ee90b52d4fb443c796f4e1481f98d5a95b5614Evan Hunt atf_tc_set_md_var(tc, "descr", "test InUse calculation");
84ee90b52d4fb443c796f4e1481f98d5a95b5614Evan Hunt result = isc_mem_createx2(0, 0, default_memalloc, default_memfree,
84ee90b52d4fb443c796f4e1481f98d5a95b5614Evan Hunt printf("inuse_before=%lu, inuse_during=%lu, inuse_after=%lu\n",
d2a50c9ba87a6c57cb310308dfe95fff2f2836e2Mark Andrews (unsigned long)after);