2 * Copyright (c) 2000-2001 Proofpoint, 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-heap.c,v 1.11 2013-11-22 20:51:43 ca Exp $")
20 extern SM_DEBUG_T SmHeapCheck;
21 # define HEAP_CHECK sm_debug_active(&SmHeapCheck, 1)
22 #else /* SM_HEAP_CHECK */
24 #endif /* SM_HEAP_CHECK */
33 sm_test_begin(argc, argv, "test heap handling");
35 sm_debug_addsettings_x(argv[1]);
39 p = sm_realloc_x(p, 20);
41 p = sm_realloc(p, 30);
45 sm_dprintf("heap with 1 30-byte block allocated:\n");
46 sm_heap_report(smioout, 3);
52 sm_dprintf("heap with 0 blocks allocated:\n");
53 sm_heap_report(smioout, 3);
54 sm_dprintf("xtrap count = %d\n", SmXtrapCount);
58 /* this will cause a core dump */
59 sm_dprintf("about to free %p for the second time\n", p);