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.
10 #pragma ident "%Z%%M% %I% %E% SMI"
13 SM_IDSTR(id
, "@(#)$Id: t-heap.c,v 1.8 2001/03/06 17:27:36 ca Exp $")
22 extern SM_DEBUG_T SmHeapCheck
;
23 # define HEAP_CHECK sm_debug_active(&SmHeapCheck, 1)
24 #else /* SM_HEAP_CHECK */
26 #endif /* SM_HEAP_CHECK */
35 sm_test_begin(argc
, argv
, "test heap handling");
37 sm_debug_addsettings_x(argv
[1]);
41 p
= sm_realloc_x(p
, 20);
43 p
= sm_realloc(p
, 30);
47 sm_dprintf("heap with 1 30-byte block allocated:\n");
48 sm_heap_report(smioout
, 3);
54 sm_dprintf("heap with 0 blocks allocated:\n");
55 sm_heap_report(smioout
, 3);
56 sm_dprintf("xtrap count = %d\n", SmXtrapCount
);
60 /* this will cause a core dump */
61 sm_dprintf("about to free %p for the second time\n", p
);