2 * Copyright (c) 2000-2001 Sendmail, Inc. and its suppliers.
5 * By using this file, you agree to the terms and conditions set
6 * forth in the LICENSE file which can be found at the top level of
7 * the sendmail distribution.
11 SM_IDSTR(id, "@(#)$Id: t-rpool.c,v 1.18 2001/09/11 04:04:49 gshapiro Exp $")
27 (void) sm_io_fprintf(smioout, SM_TIME_DEFAULT, "rfree freeing `%s'\n",
39 SM_RPOOL_ATTACH_T att;
41 sm_test_begin(argc, argv, "test rpool");
42 sm_debug_addsetting_x("sm_check_heap", 1);
43 rpool = sm_rpool_new_x(NULL);
44 SM_TEST(rpool != NULL);
45 att = sm_rpool_attach_x(rpool, rfree, "attachment #1");
47 for (i = 0; i < 26; ++i)
49 size_t sz = i * i * i;
51 a[i] = sm_rpool_malloc_x(rpool, sz);
52 for (j = 0; j < sz; ++j)
55 att = sm_rpool_attach_x(rpool, rfree, "attachment #2");
56 (void) sm_rpool_attach_x(rpool, rfree, "attachment #3");
61 sm_dprintf("heap after filling up rpool:\n");
62 sm_heap_report(smioout, 3);
63 sm_dprintf("freeing rpool:\n");
65 sm_dprintf("heap after freeing rpool:\n");
66 sm_heap_report(smioout, 3);