home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / unix / volume26 / mallc120 / part03 < prev    next >
Encoding:
Text File  |  1993-04-05  |  75.2 KB  |  2,168 lines

  1. Newsgroups: comp.sources.unix
  2. From: gray@antaire.com (Gray Watson)
  3. Subject: v26i100: malloc - debugging version of malloc, V1.2.0, Part03/05
  4. Sender: unix-sources-moderator@vix.com
  5. Approved: paul@vix.com
  6.  
  7. Submitted-By: gray@antaire.com (Gray Watson)
  8. Posting-Number: Volume 26, Issue 100
  9. Archive-Name: malloc-1.2.0/part03
  10.  
  11. #! /bin/sh
  12. # This is a shell archive.  Remove anything before this line, then unpack
  13. # it by saving it into a file and typing "sh file".  To overwrite existing
  14. # files, type "sh file -c".  You can also feed this as standard input via
  15. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  16. # will see the following message at the end:
  17. #        "End of archive 3 (of 5)."
  18. # Contents:  configure error.c error.h error_str.h error_val.h
  19. #   malloc.info
  20. # Wrapped by gray@toaster.antaire.com on Tue Apr  6 01:24:06 1993
  21. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  22. if test -f 'configure' -a "${1}" != "-c" ; then 
  23.   echo shar: Will not clobber existing file \"'configure'\"
  24. else
  25. echo shar: Extracting \"'configure'\" \(16715 characters\)
  26. sed "s/^X//" >'configure' <<'END_OF_FILE'
  27. X#!/bin/sh
  28. X# Guess values for system-dependent variables and create Makefiles.
  29. X# Generated automatically using autoconf.
  30. X# Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.
  31. X
  32. X# This program is free software; you can redistribute it and/or modify
  33. X# it under the terms of the GNU General Public License as published by
  34. X# the Free Software Foundation; either version 2, or (at your option)
  35. X# any later version.
  36. X
  37. X# This program is distributed in the hope that it will be useful,
  38. X# but WITHOUT ANY WARRANTY; without even the implied warranty of
  39. X# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  40. X# GNU General Public License for more details.
  41. X
  42. X# You should have received a copy of the GNU General Public License
  43. X# along with this program; if not, write to the Free Software
  44. X# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  45. X
  46. X# Usage: configure [--srcdir=DIR] [--host=HOST] [--gas] [--nfp] [--no-create]
  47. X#        [--prefix=PREFIX] [--exec-prefix=PREFIX] [--with-PACKAGE] [TARGET]
  48. X# Ignores all args except --srcdir, --prefix, --exec-prefix, --no-create, and
  49. X# --with-PACKAGE unless this script has special code to handle it.
  50. X
  51. X
  52. Xfor arg
  53. Xdo
  54. X  # Handle --exec-prefix with a space before the argument.
  55. X  if test x$next_exec_prefix = xyes; then exec_prefix=$arg; next_exec_prefix=
  56. X  # Handle --host with a space before the argument.
  57. X  elif test x$next_host = xyes; then next_host=
  58. X  # Handle --prefix with a space before the argument.
  59. X  elif test x$next_prefix = xyes; then prefix=$arg; next_prefix=
  60. X  # Handle --srcdir with a space before the argument.
  61. X  elif test x$next_srcdir = xyes; then srcdir=$arg; next_srcdir=
  62. X  else
  63. X    case $arg in
  64. X     # For backward compatibility, also recognize exact --exec_prefix.
  65. X     -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* | --exec=* | --exe=* | --ex=* | --e=*)
  66. X    exec_prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  67. X     -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- | --exec | --exe | --ex | --e)
  68. X    next_exec_prefix=yes ;;
  69. X
  70. X     -gas | --gas | --ga | --g) ;;
  71. X
  72. X     -host=* | --host=* | --hos=* | --ho=* | --h=*) ;;
  73. X     -host | --host | --hos | --ho | --h)
  74. X    next_host=yes ;;
  75. X
  76. X     -nfp | --nfp | --nf) ;;
  77. X
  78. X     -no-create | --no-create | --no-creat | --no-crea | --no-cre | --no-cr | --no-c | --no- | --no)
  79. X        no_create=1 ;;
  80. X
  81. X     -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
  82. X    prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  83. X     -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
  84. X    next_prefix=yes ;;
  85. X
  86. X     -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=* | --s=*)
  87. X    srcdir=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  88. X     -srcdir | --srcdir | --srcdi | --srcd | --src | --sr | --s)
  89. X    next_srcdir=yes ;;
  90. X
  91. X     -with-* | --with-*)
  92. X       package=`echo $arg|sed 's/-*with-//'`
  93. X       # Delete all the valid chars; see if any are left.
  94. X       if test -n "`echo $package|sed 's/[-a-zA-Z0-9_]*//g'`"; then
  95. X         echo "configure: $package: invalid package name" >&2; exit 1
  96. X       fi
  97. X       eval "with_`echo $package|sed s/-/_/g`=1" ;;
  98. X
  99. X     *) ;;
  100. X    esac
  101. X  fi
  102. Xdone
  103. X
  104. Xtrap 'rm -f conftest* core; exit 1' 1 3 15
  105. X
  106. Xrm -f conftest*
  107. Xcompile='${CC-cc} $DEFS conftest.c -o conftest $LIBS >/dev/null 2>&1'
  108. X
  109. X# A filename unique to this package, relative to the directory that
  110. X# configure is in, which we can look for to find out if srcdir is correct.
  111. Xunique_file=malloc.c
  112. X
  113. X# Find the source files, if location was not specified.
  114. Xif test -z "$srcdir"; then
  115. X  srcdirdefaulted=yes
  116. X  # Try the directory containing this script, then `..'.
  117. X  prog=$0
  118. X  confdir=`echo $prog|sed 's%/[^/][^/]*$%%'`
  119. X  test "X$confdir" = "X$prog" && confdir=.
  120. X  srcdir=$confdir
  121. X  if test ! -r $srcdir/$unique_file; then
  122. X    srcdir=..
  123. X  fi
  124. Xfi
  125. Xif test ! -r $srcdir/$unique_file; then
  126. X  if test x$srcdirdefaulted = xyes; then
  127. X    echo "configure: Can not find sources in \`${confdir}' or \`..'." 1>&2
  128. X  else
  129. X    echo "configure: Can not find sources in \`${srcdir}'." 1>&2
  130. X  fi
  131. X  exit 1
  132. Xfi
  133. X# Preserve a srcdir of `.' to avoid automounter screwups with pwd.
  134. X# But we can't avoid them for `..', to make subdirectories work.
  135. Xcase $srcdir in
  136. X  .|/*|~*) ;;
  137. X  *) srcdir=`cd $srcdir; pwd` ;; # Make relative path absolute.
  138. Xesac
  139. X
  140. X
  141. Xecho Configuring for the malloc-debug library
  142. Xecho .
  143. Xecho checking programs:
  144. Xif test -z "$CC"; then
  145. X  echo checking for gcc
  146. X  saveifs="$IFS"; IFS="${IFS}:"
  147. X  for dir in $PATH; do
  148. X    test -z "$dir" && dir=.
  149. X    if test -f $dir/gcc; then
  150. X      CC="gcc"
  151. X      break
  152. X    fi
  153. X  done
  154. X  IFS="$saveifs"
  155. Xfi
  156. Xtest -z "$CC" && CC="cc"
  157. X
  158. X# Find out if we are using GNU C, under whatever name.
  159. Xcat > conftest.c <<EOF
  160. X#ifdef __GNUC__
  161. X  yes
  162. X#endif
  163. XEOF
  164. X${CC-cc} -E conftest.c > conftest.out 2>&1
  165. Xif egrep yes conftest.out >/dev/null 2>&1; then
  166. X  GCC=1 # For later tests.
  167. Xfi
  168. Xrm -f conftest*
  169. X
  170. X# Make sure to not get the incompatible SysV /etc/install and
  171. X# /usr/sbin/install, which might be in PATH before a BSD-like install,
  172. X# or the SunOS /usr/etc/install directory, or the AIX /bin/install,
  173. X# or the AFS install, which mishandles nonexistent args.  (Sigh.)
  174. Xif test -z "$INSTALL"; then
  175. X  echo checking for install
  176. X  saveifs="$IFS"; IFS="${IFS}:"
  177. X  for dir in $PATH; do
  178. X    test -z "$dir" && dir=.
  179. X    case $dir in
  180. X    /etc|/usr/sbin|/usr/etc|/usr/afsws/bin) ;;
  181. X    *)
  182. X      if test -f $dir/install; then
  183. X    if grep dspmsg $dir/install >/dev/null 2>&1; then
  184. X      : # AIX
  185. X    else
  186. X      INSTALL="$dir/install -c"
  187. X      INSTALL_PROGRAM='$(INSTALL)'
  188. X      INSTALL_DATA='$(INSTALL) -m 644'
  189. X      break
  190. X    fi
  191. X      fi
  192. X      ;;
  193. X    esac
  194. X  done
  195. X  IFS="$saveifs"
  196. Xfi
  197. XINSTALL=${INSTALL-cp}
  198. XINSTALL_PROGRAM=${INSTALL_PROGRAM-'$(INSTALL)'}
  199. XINSTALL_DATA=${INSTALL_DATA-'$(INSTALL)'}
  200. X
  201. Xif test -z "$RANLIB"; then
  202. X  echo checking for ranlib
  203. X  saveifs="$IFS"; IFS="${IFS}:"
  204. X  for dir in $PATH; do
  205. X    test -z "$dir" && dir=.
  206. X    if test -f $dir/ranlib; then
  207. X      RANLIB="ranlib"
  208. X      break
  209. X    fi
  210. X  done
  211. X  IFS="$saveifs"
  212. Xfi
  213. Xtest -z "$RANLIB" && RANLIB="@:"
  214. X
  215. Xecho .
  216. Xecho checking functions:
  217. Xfor func in bcmp bcopy memcmp memcpy memset
  218. Xdo
  219. Xtrfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'`
  220. Xecho checking for ${func}
  221. Xcat > conftest.c <<EOF
  222. X#include <stdio.h>
  223. Xmain() { exit(0); } 
  224. Xt() { 
  225. X#ifdef __stub_${func}
  226. Xchoke me
  227. X#else
  228. X/* Override any gcc2 internal prototype to avoid an error.  */
  229. Xextern char ${func}(); ${func}();
  230. X#endif
  231. X }
  232. XEOF
  233. Xif eval $compile; then
  234. X  DEFS="$DEFS -D${trfunc}=1"
  235. XSEDDEFS="${SEDDEFS}\${SEDdA}${trfunc}\${SEDdB}${trfunc}\${SEDdC}1\${SEDdD}
  236. X\${SEDuA}${trfunc}\${SEDuB}${trfunc}\${SEDuC}1\${SEDuD}
  237. X\${SEDeA}${trfunc}\${SEDeB}${trfunc}\${SEDeC}1\${SEDeD}
  238. X"
  239. Xfi
  240. Xrm -f conftest*
  241. X#endif
  242. Xdone
  243. X
  244. Xecho checking for _index
  245. Xcat > conftest.c <<EOF
  246. X
  247. Xmain() { exit(0); }
  248. Xt() {
  249. X#ifdef __stub_index
  250. Xchoke me
  251. X#else
  252. X/* Override any gcc2 internal prototype to avoid an error.  */
  253. Xextern char index(); index();
  254. X#endif
  255. X }
  256. X
  257. XEOF
  258. Xeval $compile
  259. Xif test -s conftest && (./conftest; exit) 2>/dev/null; then
  260. X  
  261. XDEFS="$DEFS -DHAVE_INDEX=1"
  262. XSEDDEFS="${SEDDEFS}\${SEDdA}HAVE_INDEX\${SEDdB}HAVE_INDEX\${SEDdC}1\${SEDdD}
  263. X\${SEDuA}HAVE_INDEX\${SEDuB}HAVE_INDEX\${SEDuC}1\${SEDuD}
  264. X\${SEDeA}HAVE_INDEX\${SEDeB}HAVE_INDEX\${SEDeC}1\${SEDeD}
  265. X"
  266. X
  267. Xelse
  268. X  
  269. XDEFS="$DEFS -DHAVE_INDEX=0"
  270. XSEDDEFS="${SEDDEFS}\${SEDdA}HAVE_INDEX\${SEDdB}HAVE_INDEX\${SEDdC}0\${SEDdD}
  271. X\${SEDuA}HAVE_INDEX\${SEDuB}HAVE_INDEX\${SEDuC}0\${SEDuD}
  272. X\${SEDeA}HAVE_INDEX\${SEDeB}HAVE_INDEX\${SEDeC}0\${SEDeD}
  273. X"
  274. X
  275. Xfi
  276. Xrm -f conftest*
  277. Xfor func in rindex
  278. Xdo
  279. Xtrfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'`
  280. Xecho checking for ${func}
  281. Xcat > conftest.c <<EOF
  282. X#include <stdio.h>
  283. Xmain() { exit(0); } 
  284. Xt() { 
  285. X#ifdef __stub_${func}
  286. Xchoke me
  287. X#else
  288. X/* Override any gcc2 internal prototype to avoid an error.  */
  289. Xextern char ${func}(); ${func}();
  290. X#endif
  291. X }
  292. XEOF
  293. Xif eval $compile; then
  294. X  DEFS="$DEFS -D${trfunc}=1"
  295. XSEDDEFS="${SEDDEFS}\${SEDdA}${trfunc}\${SEDdB}${trfunc}\${SEDdC}1\${SEDdD}
  296. X\${SEDuA}${trfunc}\${SEDuB}${trfunc}\${SEDuC}1\${SEDuD}
  297. X\${SEDeA}${trfunc}\${SEDeB}${trfunc}\${SEDeC}1\${SEDeD}
  298. X"
  299. Xfi
  300. Xrm -f conftest*
  301. X#endif
  302. Xdone
  303. X
  304. Xfor func in strcat strcmp strlen strtok
  305. Xdo
  306. Xtrfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'`
  307. Xecho checking for ${func}
  308. Xcat > conftest.c <<EOF
  309. X#include <stdio.h>
  310. Xmain() { exit(0); } 
  311. Xt() { 
  312. X#ifdef __stub_${func}
  313. Xchoke me
  314. X#else
  315. X/* Override any gcc2 internal prototype to avoid an error.  */
  316. Xextern char ${func}(); ${func}();
  317. X#endif
  318. X }
  319. XEOF
  320. Xif eval $compile; then
  321. X  DEFS="$DEFS -D${trfunc}=1"
  322. XSEDDEFS="${SEDDEFS}\${SEDdA}${trfunc}\${SEDdB}${trfunc}\${SEDdC}1\${SEDdD}
  323. X\${SEDuA}${trfunc}\${SEDuB}${trfunc}\${SEDuC}1\${SEDuD}
  324. X\${SEDeA}${trfunc}\${SEDeB}${trfunc}\${SEDeC}1\${SEDeD}
  325. X"
  326. Xfi
  327. Xrm -f conftest*
  328. X#endif
  329. Xdone
  330. X
  331. Xecho .
  332. Xecho checking various functions for string checking
  333. Xfor func in bzero
  334. Xdo
  335. Xtrfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'`
  336. Xecho checking for ${func}
  337. Xcat > conftest.c <<EOF
  338. X#include <stdio.h>
  339. Xmain() { exit(0); } 
  340. Xt() { 
  341. X#ifdef __stub_${func}
  342. Xchoke me
  343. X#else
  344. X/* Override any gcc2 internal prototype to avoid an error.  */
  345. Xextern char ${func}(); ${func}();
  346. X#endif
  347. X }
  348. XEOF
  349. Xif eval $compile; then
  350. X  DEFS="$DEFS -D${trfunc}=1"
  351. XSEDDEFS="${SEDDEFS}\${SEDdA}${trfunc}\${SEDdB}${trfunc}\${SEDdC}1\${SEDdD}
  352. X\${SEDuA}${trfunc}\${SEDuB}${trfunc}\${SEDuC}1\${SEDuD}
  353. X\${SEDeA}${trfunc}\${SEDeB}${trfunc}\${SEDeC}1\${SEDeD}
  354. X"
  355. Xfi
  356. Xrm -f conftest*
  357. X#endif
  358. Xdone
  359. X
  360. Xfor func in memccpy memchr
  361. Xdo
  362. Xtrfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'`
  363. Xecho checking for ${func}
  364. Xcat > conftest.c <<EOF
  365. X#include <stdio.h>
  366. Xmain() { exit(0); } 
  367. Xt() { 
  368. X#ifdef __stub_${func}
  369. Xchoke me
  370. X#else
  371. X/* Override any gcc2 internal prototype to avoid an error.  */
  372. Xextern char ${func}(); ${func}();
  373. X#endif
  374. X }
  375. XEOF
  376. Xif eval $compile; then
  377. X  DEFS="$DEFS -D${trfunc}=1"
  378. XSEDDEFS="${SEDDEFS}\${SEDdA}${trfunc}\${SEDdB}${trfunc}\${SEDdC}1\${SEDdD}
  379. X\${SEDuA}${trfunc}\${SEDuB}${trfunc}\${SEDuC}1\${SEDuD}
  380. X\${SEDeA}${trfunc}\${SEDeB}${trfunc}\${SEDeC}1\${SEDeD}
  381. X"
  382. Xfi
  383. Xrm -f conftest*
  384. X#endif
  385. Xdone
  386. X
  387. Xfor func in strchr strrchr strcpy strncpy strcasecmp strncasecmp
  388. Xdo
  389. Xtrfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'`
  390. Xecho checking for ${func}
  391. Xcat > conftest.c <<EOF
  392. X#include <stdio.h>
  393. Xmain() { exit(0); } 
  394. Xt() { 
  395. X#ifdef __stub_${func}
  396. Xchoke me
  397. X#else
  398. X/* Override any gcc2 internal prototype to avoid an error.  */
  399. Xextern char ${func}(); ${func}();
  400. X#endif
  401. X }
  402. XEOF
  403. Xif eval $compile; then
  404. X  DEFS="$DEFS -D${trfunc}=1"
  405. XSEDDEFS="${SEDDEFS}\${SEDdA}${trfunc}\${SEDdB}${trfunc}\${SEDdC}1\${SEDdD}
  406. X\${SEDuA}${trfunc}\${SEDuB}${trfunc}\${SEDuC}1\${SEDuD}
  407. X\${SEDeA}${trfunc}\${SEDeB}${trfunc}\${SEDeC}1\${SEDeD}
  408. X"
  409. Xfi
  410. Xrm -f conftest*
  411. X#endif
  412. Xdone
  413. X
  414. Xfor func in strspn strcspn strncat strncmp strpbrk strstr
  415. Xdo
  416. Xtrfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'`
  417. Xecho checking for ${func}
  418. Xcat > conftest.c <<EOF
  419. X#include <stdio.h>
  420. Xmain() { exit(0); } 
  421. Xt() { 
  422. X#ifdef __stub_${func}
  423. Xchoke me
  424. X#else
  425. X/* Override any gcc2 internal prototype to avoid an error.  */
  426. Xextern char ${func}(); ${func}();
  427. X#endif
  428. X }
  429. XEOF
  430. Xif eval $compile; then
  431. X  DEFS="$DEFS -D${trfunc}=1"
  432. XSEDDEFS="${SEDDEFS}\${SEDdA}${trfunc}\${SEDdB}${trfunc}\${SEDdC}1\${SEDdD}
  433. X\${SEDuA}${trfunc}\${SEDuB}${trfunc}\${SEDuC}1\${SEDuD}
  434. X\${SEDeA}${trfunc}\${SEDeB}${trfunc}\${SEDeC}1\${SEDeD}
  435. X"
  436. Xfi
  437. Xrm -f conftest*
  438. X#endif
  439. Xdone
  440. X
  441. Xecho .
  442. Xecho PLEASE WATCH: checking for very important functionality:
  443. Xfor func in sbrk
  444. Xdo
  445. Xtrfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'`
  446. Xecho checking for ${func}
  447. Xcat > conftest.c <<EOF
  448. X#include <stdio.h>
  449. Xmain() { exit(0); } 
  450. Xt() { 
  451. X#ifdef __stub_${func}
  452. Xchoke me
  453. X#else
  454. X/* Override any gcc2 internal prototype to avoid an error.  */
  455. Xextern char ${func}(); ${func}();
  456. X#endif
  457. X }
  458. XEOF
  459. Xif eval $compile; then
  460. X  DEFS="$DEFS -D${trfunc}=1"
  461. XSEDDEFS="${SEDDEFS}\${SEDdA}${trfunc}\${SEDdB}${trfunc}\${SEDdC}1\${SEDdD}
  462. X\${SEDuA}${trfunc}\${SEDuB}${trfunc}\${SEDuC}1\${SEDuD}
  463. X\${SEDeA}${trfunc}\${SEDeB}${trfunc}\${SEDeC}1\${SEDeD}
  464. X"
  465. Xfi
  466. Xrm -f conftest*
  467. X#endif
  468. Xdone
  469. X
  470. Xecho checking for heap ordering...
  471. Xcat > conftest.c <<EOF
  472. X
  473. Xmain()
  474. X{
  475. X  char    * first, *next;
  476. X  first = sbrk(1024);
  477. X  next = sbrk(1024);
  478. X  if (next > first)
  479. X    exit(0);
  480. X  else
  481. X    exit(1);
  482. X}
  483. X
  484. XEOF
  485. Xeval $compile
  486. Xif test -s conftest && (./conftest; exit) 2>/dev/null; then
  487. X  
  488. XDEFS="$DEFS -DHEAP_GROWS_UP=1"
  489. XSEDDEFS="${SEDDEFS}\${SEDdA}HEAP_GROWS_UP\${SEDdB}HEAP_GROWS_UP\${SEDdC}1\${SEDdD}
  490. X\${SEDuA}HEAP_GROWS_UP\${SEDuB}HEAP_GROWS_UP\${SEDuC}1\${SEDuD}
  491. X\${SEDeA}HEAP_GROWS_UP\${SEDeB}HEAP_GROWS_UP\${SEDeC}1\${SEDeD}
  492. X"
  493. Xecho '   FYI: your heap seems to grow up.'
  494. X
  495. Xelse
  496. X  
  497. XDEFS="$DEFS -DHEAP_GROWS_UP=0"
  498. XSEDDEFS="${SEDDEFS}\${SEDdA}HEAP_GROWS_UP\${SEDdB}HEAP_GROWS_UP\${SEDdC}0\${SEDdD}
  499. X\${SEDuA}HEAP_GROWS_UP\${SEDuB}HEAP_GROWS_UP\${SEDuC}0\${SEDuD}
  500. X\${SEDeA}HEAP_GROWS_UP\${SEDeB}HEAP_GROWS_UP\${SEDeC}0\${SEDeD}
  501. X"
  502. Xecho '   FYI: your heap seems to grow down.'
  503. Xecho '   WARNING: the library has little support for this.'
  504. X
  505. Xfi
  506. Xrm -f conftest*
  507. Xecho .
  508. Xif test -n "$prefix"; then
  509. X  test -z "$exec_prefix" && exec_prefix='${prefix}'
  510. X  prsub="s%^prefix\\([     ]*\\)=\\([     ]*\\).*$%prefix\\1=\\2$prefix%"
  511. Xfi
  512. Xif test -n "$exec_prefix"; then
  513. X  prsub="$prsub
  514. Xs%^exec_prefix\\([     ]*\\)=\\([     ]*\\).*$%\
  515. Xexec_prefix\\1=\\2$exec_prefix%"
  516. Xfi
  517. X
  518. Xtrap 'rm -f config.status; exit 1' 1 3 15
  519. Xecho creating config.status
  520. Xrm -f config.status
  521. Xcat > config.status <<EOF
  522. X#!/bin/sh
  523. X# Generated automatically by configure.
  524. X# Run this file to recreate the current configuration.
  525. X# This directory was configured as follows,
  526. X# on host `(hostname || uname -n) 2>/dev/null`:
  527. X#
  528. X# $0 $*
  529. X
  530. Xfor arg
  531. Xdo
  532. X  case "\$arg" in
  533. X    -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
  534. X    exec /bin/sh $0 $* ;;
  535. X    *) echo "Usage: config.status --recheck" 2>&1; exit 1 ;;
  536. X  esac
  537. Xdone
  538. X
  539. Xtrap 'rm -f Makefile conf.h conftest*; exit 1' 1 3 15
  540. XCC='$CC'
  541. XINSTALL='$INSTALL'
  542. XINSTALL_PROGRAM='$INSTALL_PROGRAM'
  543. XINSTALL_DATA='$INSTALL_DATA'
  544. XRANLIB='$RANLIB'
  545. XLIBS='$LIBS'
  546. Xsrcdir='$srcdir'
  547. Xprefix='$prefix'
  548. Xexec_prefix='$exec_prefix'
  549. Xprsub='$prsub'
  550. XEOF
  551. Xcat >> config.status <<\EOF
  552. X
  553. Xtop_srcdir=$srcdir
  554. Xfor file in .. Makefile; do if [ "x$file" != "x.." ]; then
  555. X  srcdir=$top_srcdir
  556. X  # Remove last slash and all that follows it.  Not all systems have dirname.
  557. X  dir=`echo $file|sed 's%/[^/][^/]*$%%'`
  558. X  if test "$dir" != "$file"; then
  559. X    test "$top_srcdir" != . && srcdir=$top_srcdir/$dir
  560. X    test ! -d $dir && mkdir $dir
  561. X  fi
  562. X  echo creating $file
  563. X  rm -f $file
  564. X  echo "# Generated automatically from `echo $file|sed 's|.*/||'`.in by configure." > $file
  565. X  sed -e "
  566. X$prsub
  567. Xs%@CC@%$CC%g
  568. Xs%@INSTALL@%$INSTALL%g
  569. Xs%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
  570. Xs%@INSTALL_DATA@%$INSTALL_DATA%g
  571. Xs%@RANLIB@%$RANLIB%g
  572. Xs%@LIBS@%$LIBS%g
  573. Xs%@srcdir@%$srcdir%g
  574. Xs%@DEFS@%-DHAVE_CONFIG_H%" $top_srcdir/${file}.in >> $file
  575. Xfi; done
  576. X
  577. Xecho creating conf.h
  578. X# These sed commands are put into SEDDEFS when defining a macro.
  579. X# They are broken into pieces to make the sed script easier to manage.
  580. X# They are passed to sed as "A NAME B NAME C VALUE D", where NAME
  581. X# is the cpp macro being defined and VALUE is the value it is being given.
  582. X# Each defining turns into a single global substitution command.
  583. X#
  584. X# SEDd sets the value in "#define NAME VALUE" lines.
  585. XSEDdA='s@^\([     ]*\)#\([     ]*define[     ][     ]*\)'
  586. XSEDdB='\([     ][     ]*\)[^     ]*@\1#\2'
  587. XSEDdC='\3'
  588. XSEDdD='@g'
  589. X# SEDu turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
  590. XSEDuA='s@^\([     ]*\)#\([     ]*\)undef\([     ][     ]*\)'
  591. XSEDuB='\([     ]\)@\1#\2define\3'
  592. XSEDuC=' '
  593. XSEDuD='\4@g'
  594. X# SEDe turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
  595. XSEDeA='s@^\([     ]*\)#\([     ]*\)undef\([     ][     ]*\)'
  596. XSEDeB='$@\1#\2define\3'
  597. XSEDeC=' '
  598. XSEDeD='@g'
  599. Xrm -f conftest.sed
  600. Xcat > conftest.sed <<CONFEOF
  601. XEOF
  602. X# Turn off quoting long enough to insert the sed commands.
  603. Xcat >> config.status <<EOF
  604. X$SEDDEFS
  605. XEOF
  606. Xcat >> config.status <<\EOF
  607. XCONFEOF
  608. Xrm -f conftest.h
  609. X# Break up the sed commands because old seds have small limits.
  610. Xcp $top_srcdir/conf.h.in conftest.h1
  611. Xwhile :
  612. Xdo
  613. X  lines=`grep -c . conftest.sed`
  614. X  if test -z "$lines" || test "$lines" -eq 0; then break; fi
  615. X  rm -f conftest.s1 conftest.s2 conftest.h2
  616. X  sed 40q conftest.sed > conftest.s1 # Like head -40.
  617. X  sed 1,40d conftest.sed > conftest.s2 # Like tail +41.
  618. X  sed -f conftest.s1 < conftest.h1 > conftest.h2
  619. X  rm -f conftest.s1 conftest.h1 conftest.sed
  620. X  mv conftest.h2 conftest.h1
  621. X  mv conftest.s2 conftest.sed
  622. Xdone
  623. Xrm -f conftest.sed conftest.h
  624. Xecho "/* conf.h.  Generated automatically by configure.  */" > conftest.h
  625. Xcat conftest.h1 >> conftest.h
  626. Xrm -f conftest.h1
  627. Xif cmp -s conf.h conftest.h 2>/dev/null; then
  628. X  # The file exists and we would not be changing it.
  629. X  rm -f conftest.h
  630. Xelse
  631. X  rm -f conf.h
  632. X  mv conftest.h conf.h
  633. Xfi
  634. X
  635. XEOF
  636. Xchmod +x config.status
  637. Xtest -n "$no_create" || ./config.status
  638. X
  639. Xecho .
  640. Xecho Done!!
  641. Xecho created conf.h and Makefile.
  642. Xecho Please check-out Makefile and especially conf.h to make sure that
  643. Xecho     sane configuration values were a result.
  644. END_OF_FILE
  645. if test 16715 -ne `wc -c <'configure'`; then
  646.     echo shar: \"'configure'\" unpacked with wrong size!
  647. fi
  648. chmod +x 'configure'
  649. # end of 'configure'
  650. fi
  651. if test -f 'error.c' -a "${1}" != "-c" ; then 
  652.   echo shar: Will not clobber existing file \"'error.c'\"
  653. else
  654. echo shar: Extracting \"'error.c'\" \(3964 characters\)
  655. sed "s/^X//" >'error.c' <<'END_OF_FILE'
  656. X/*
  657. X * error and message routines
  658. X *
  659. X * Copyright 1992 by Gray Watson and the Antaire Corporation
  660. X *
  661. X * This file is part of the malloc-debug package.
  662. X *
  663. X * This library is free software; you can redistribute it and/or
  664. X * modify it under the terms of the GNU Library General Public
  665. X * License as published by the Free Software Foundation; either
  666. X * version 2 of the License, or (at your option) any later version.
  667. X *
  668. X * This library is distributed in the hope that it will be useful,
  669. X * but WITHOUT ANY WARRANTY; without even the implied warranty of
  670. X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  671. X * Library General Public License for more details.
  672. X *
  673. X * You should have received a copy of the GNU Library General Public
  674. X * License along with this library (see COPYING-LIB); if not, write to the
  675. X * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  676. X *
  677. X * The author of the program may be contacted at gray.watson@antaire.com
  678. X */
  679. X
  680. X/*
  681. X * This file contains the routines needed for processing error codes
  682. X * produced by the compiler.
  683. X */
  684. X
  685. X#include <fcntl.h>                /* for O_WRONLY, etc. */
  686. X#include <signal.h>                /* for kill signals */
  687. X#include <stdarg.h>                /* for message vsprintf */
  688. X
  689. X#define MALLOC_DEBUG_DISABLE
  690. X
  691. X#include "malloc.h"
  692. X#include "malloc_loc.h"
  693. X
  694. X#include "chunk.h"
  695. X#include "compat.h"
  696. X#include "conf.h"
  697. X#include "dbg_values.h"
  698. X#include "error.h"
  699. X
  700. X#if INCLUDE_RCS_IDS
  701. XLOCAL    char    *rcs_id =
  702. X  "$Id: error.c,v 1.19 1993/04/05 22:30:07 gray Exp $";
  703. X#endif
  704. X
  705. X/*
  706. X * exported variables
  707. X */
  708. X/* global debug flags that are set my MALLOC_DEBUG environ variable */
  709. XEXPORT    int        _malloc_debug = 0;
  710. X
  711. X/*
  712. X * message writer with printf like arguments
  713. X */
  714. XEXPORT    void    _malloc_message(const char * format, ...)
  715. X{
  716. X  static int    outfile = -1;
  717. X  int        len;
  718. X  char        str[1024];
  719. X  va_list    args;
  720. X  
  721. X  /* no logpath then no workie */
  722. X  if (malloc_logpath == NULL
  723. X      && ! BIT_IS_SET(_malloc_debug, DEBUG_PRINT_PERROR))
  724. X    return;
  725. X  
  726. X  /* write the format + info into str */
  727. X  va_start(args, format);
  728. X  (void)vsprintf(str, format, args);
  729. X  va_end(args);
  730. X  
  731. X  /* find the length of str, if empty then return */
  732. X  len = strlen(str);
  733. X  if (len == 0)
  734. X    return;
  735. X  
  736. X  /* tack on a '\n' if necessary */
  737. X  if (str[len - 1] != '\n') {
  738. X    str[len++] = '\n';
  739. X    str[len] = NULLC;
  740. X  }
  741. X  
  742. X  /* do we need to log the message? */
  743. X  if (BIT_IS_SET(_malloc_debug, DEBUG_LOG_PERROR) && malloc_logpath != NULL) {
  744. X    /*
  745. X     * do we need to open the outfile?
  746. X     * it will be closed by _exit().  yeach.
  747. X     */
  748. X    if (outfile < 0) {
  749. X      outfile = open(malloc_logpath, O_WRONLY | O_CREAT | O_TRUNC, 0666);
  750. X      if (outfile < 0) {
  751. X    (void)sprintf(str, "%s:%d: could not open '%s'\n",
  752. X              __FILE__, __LINE__, malloc_logpath);
  753. X    (void)write(STDERR, str, strlen(str));
  754. X    exit(1);
  755. X      }
  756. X    }
  757. X    
  758. X    /* write str to the outfile */
  759. X    (void)write(outfile, str, len);
  760. X  }
  761. X  
  762. X  /* do we need to print the message? */
  763. X  if (BIT_IS_SET(_malloc_debug, DEBUG_PRINT_PERROR)) {
  764. X    (void)write(STDERR, str, strlen(str));
  765. X  }
  766. X}
  767. X
  768. X/*
  769. X * kill the program because of an internal malloc error
  770. X */
  771. XEXPORT    void    _malloc_die(void)
  772. X{
  773. X  /* do I need to drop core? */
  774. X  if (BIT_IS_SET(_malloc_debug, DEBUG_ERROR_ABORT))
  775. X    (void)kill(getpid(), SIGABRT);
  776. X  
  777. X  /*
  778. X   * NOTE: this should not be exit() because fclose will free, etc
  779. X   */
  780. X  _exit(1);
  781. X}
  782. X
  783. X/*
  784. X * malloc version of perror of an error in STR
  785. X */
  786. XEXPORT    void    _malloc_perror(const char * func)
  787. X{
  788. X  /* do we need to log or print the error? */
  789. X  if ((BIT_IS_SET(_malloc_debug, DEBUG_LOG_PERROR) && malloc_logpath != NULL)
  790. X      || BIT_IS_SET(_malloc_debug, DEBUG_PRINT_PERROR)) {
  791. X    
  792. X    /* default str value */
  793. X    if (func == NULL)
  794. X      func = "malloc_perror";
  795. X    
  796. X    /* print the malloc error message */
  797. X    _malloc_message("ERROR: %s: %s(%d)",
  798. X            func, malloc_strerror(malloc_errno), malloc_errno);
  799. X  }
  800. X  
  801. X  /* do I need to abort? */
  802. X  if (BIT_IS_SET(_malloc_debug, DEBUG_ERROR_ABORT))
  803. X    _malloc_die();
  804. X}
  805. END_OF_FILE
  806. if test 3964 -ne `wc -c <'error.c'`; then
  807.     echo shar: \"'error.c'\" unpacked with wrong size!
  808. fi
  809. # end of 'error.c'
  810. fi
  811. if test -f 'error.h' -a "${1}" != "-c" ; then 
  812.   echo shar: Will not clobber existing file \"'error.h'\"
  813. else
  814. echo shar: Extracting \"'error.h'\" \(1737 characters\)
  815. sed "s/^X//" >'error.h' <<'END_OF_FILE'
  816. X/*
  817. X * defines for the error and message code.
  818. X *
  819. X * Copyright 1992 by Gray Watson and the Antaire Corporation
  820. X *
  821. X * This file is part of the malloc-debug package.
  822. X *
  823. X * This library is free software; you can redistribute it and/or
  824. X * modify it under the terms of the GNU Library General Public
  825. X * License as published by the Free Software Foundation; either
  826. X * version 2 of the License, or (at your option) any later version.
  827. X *
  828. X * This library is distributed in the hope that it will be useful,
  829. X * but WITHOUT ANY WARRANTY; without even the implied warranty of
  830. X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  831. X * Library General Public License for more details.
  832. X *
  833. X * You should have received a copy of the GNU Library General Public
  834. X * License along with this library (see COPYING-LIB); if not, write to the
  835. X * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  836. X *
  837. X * The author of the program may be contacted at gray.watson@antaire.com
  838. X *
  839. X * $Id: error.h,v 1.7 1993/04/05 22:30:08 gray Exp $
  840. X */
  841. X
  842. X#ifndef __ERROR_H__
  843. X#define __ERROR_H__
  844. X
  845. X#include <stdarg.h>            /* for ... */
  846. X#include "malloc.h"            /* for IMPORT */
  847. X
  848. X/*<<<<<<<<<<  The below prototypes are auto-generated by fillproto */
  849. X
  850. X/* global debug flags that are set my MALLOC_DEBUG environ variable */
  851. XIMPORT    int        _malloc_debug;
  852. X
  853. X/*
  854. X * message writer with printf like arguments
  855. X */
  856. XIMPORT    void    _malloc_message(const char * format, ...);
  857. X
  858. X/*
  859. X * kill the program because of an internal malloc error
  860. X */
  861. XIMPORT    void    _malloc_die(void);
  862. X
  863. X/*
  864. X * malloc version of perror of an error in STR
  865. X */
  866. XIMPORT    void    _malloc_perror(const char * func);
  867. X
  868. X/*<<<<<<<<<<   This is end of the auto-generated output from fillproto. */
  869. X
  870. X#endif /* ! __ERROR_H__ */
  871. END_OF_FILE
  872. if test 1737 -ne `wc -c <'error.h'`; then
  873.     echo shar: \"'error.h'\" unpacked with wrong size!
  874. fi
  875. # end of 'error.h'
  876. fi
  877. if test -f 'error_str.h' -a "${1}" != "-c" ; then 
  878.   echo shar: Will not clobber existing file \"'error_str.h'\"
  879. else
  880. echo shar: Extracting \"'error_str.h'\" \(3288 characters\)
  881. sed "s/^X//" >'error_str.h' <<'END_OF_FILE'
  882. X/*
  883. X * array of error messages for the malloc internal errors.
  884. X *
  885. X * Copyright 1992 by Gray Watson and the Antaire Corporation
  886. X *
  887. X * This file is part of the malloc-debug package.
  888. X *
  889. X * This library is free software; you can redistribute it and/or
  890. X * modify it under the terms of the GNU Library General Public
  891. X * License as published by the Free Software Foundation; either
  892. X * version 2 of the License, or (at your option) any later version.
  893. X *
  894. X * This library is distributed in the hope that it will be useful,
  895. X * but WITHOUT ANY WARRANTY; without even the implied warranty of
  896. X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  897. X * Library General Public License for more details.
  898. X *
  899. X * You should have received a copy of the GNU Library General Public
  900. X * License along with this library (see COPYING-LIB); if not, write to the
  901. X * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  902. X *
  903. X * The author of the program may be contacted at gray.watson@antaire.com
  904. X *
  905. X * $Id: error_str.h,v 1.5 1993/04/05 22:30:10 gray Exp $
  906. X */
  907. X
  908. X#ifndef __ERROR_STR_H__
  909. X#define __ERROR_STR_H__
  910. X
  911. X/* string error codes which apply to error codes in error_val.h */
  912. XLOCAL    char    *malloc_errlist[] = {
  913. X  "no error",
  914. X  
  915. X  /* administrative errors */
  916. X  "initialization sanity checks on setup values failed",
  917. X  "malloc domain has been entered twice",
  918. X  "errno value passed in by user is out-of-bounds",
  919. X  
  920. X  /* pointer verification errors */
  921. X  "pointer is null",
  922. X  "pointer is not pointing into the heap data space",
  923. X  "cannot locate pointer in the heap",
  924. X  "found pointer the user was looking for",
  925. X  "possibly bad .c filename pointer",
  926. X  "possibly bad .c file line-number",
  927. X  "failed UNDER picket-fence magic-number checking",
  928. X  "failed OVER picket-fence magic-number checking",
  929. X  "pointer will exceed allocation",
  930. X  
  931. X  /* allocation errors */
  932. X  "invalid allocation size",
  933. X  "largest maximum allocation size exceeded",
  934. X  "user allocated space contiguous block error",
  935. X  "could allocate more memory, heap extension failed",
  936. X  "bad size in information structure",
  937. X  
  938. X  /* free errors */
  939. X  "pointer is not on a block boundary",
  940. X  "tried to free pointer which is already freed",
  941. X  "pointer does not point to start of user-allocated space",
  942. X  "pointer does not point to user-allocated space",
  943. X  "inconsistency with free linked-list",
  944. X  "free space contiguous block error",
  945. X  "bad basic-block memory pointer in the free-list",
  946. X  "space that should be free has been overwritten",
  947. X  
  948. X  /* dblock errors */
  949. X  "bad divided-block chunk size",
  950. X  "bad divided-block pointer",
  951. X  "bad basic-block memory pointer in dblock struct",
  952. X  "bad divided-block admin pointer",
  953. X  "bad divided-block admin magic numbers",
  954. X  "bad divided-block chunk admin information structure",
  955. X  
  956. X  /* administrative errors */
  957. X  "admin structure pointer out of bounds",
  958. X  "bad admin structure list",
  959. X  "bad magic number in admin structure",
  960. X  "bad basic-block count value in admin structure",
  961. X  "bad basic-block administration pointer",
  962. X  "bad basic-block administration counter",
  963. X  
  964. X  /* heap check verification */
  965. X  "bad basic-block allocation order",
  966. X  "basic-block has bad flag value",
  967. X  
  968. X  "PROBLEM - BAD ERRNO VALUE",
  969. X  "PROBLEM - BAD ERRNO VALUE",
  970. X  "PROBLEM - BAD ERRNO VALUE",
  971. X};
  972. X
  973. X#endif /* ! __ERROR_STR_H__ */
  974. END_OF_FILE
  975. if test 3288 -ne `wc -c <'error_str.h'`; then
  976.     echo shar: \"'error_str.h'\" unpacked with wrong size!
  977. fi
  978. # end of 'error_str.h'
  979. fi
  980. if test -f 'error_val.h' -a "${1}" != "-c" ; then 
  981.   echo shar: Will not clobber existing file \"'error_val.h'\"
  982. else
  983. echo shar: Extracting \"'error_val.h'\" \(3812 characters\)
  984. sed "s/^X//" >'error_val.h' <<'END_OF_FILE'
  985. X/*
  986. X * global error codes for chunk allocation problems
  987. X *
  988. X * Copyright 1992 by Gray Watson and the Antaire Corporation
  989. X *
  990. X * This file is part of the malloc-debug package.
  991. X *
  992. X * This library is free software; you can redistribute it and/or
  993. X * modify it under the terms of the GNU Library General Public
  994. X * License as published by the Free Software Foundation; either
  995. X * version 2 of the License, or (at your option) any later version.
  996. X *
  997. X * This library is distributed in the hope that it will be useful,
  998. X * but WITHOUT ANY WARRANTY; without even the implied warranty of
  999. X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  1000. X * Library General Public License for more details.
  1001. X *
  1002. X * You should have received a copy of the GNU Library General Public
  1003. X * License along with this library (see COPYING-LIB); if not, write to the
  1004. X * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  1005. X *
  1006. X * The author of the program may be contacted at gray.watson@antaire.com
  1007. X *
  1008. X * $Id: error_val.h,v 1.2 1993/04/05 22:30:12 gray Exp $
  1009. X */
  1010. X
  1011. X#ifndef __ERROR_VAL_H__
  1012. X#define __ERROR_VAL_H__
  1013. X
  1014. X/*
  1015. X * malloc error codes
  1016. X */
  1017. X#define MALLOC_NO_ERROR            0    /* no error */
  1018. X
  1019. X/* administrative errors */
  1020. X#define MALLOC_BAD_SETUP        1    /* bad setup value */
  1021. X#define MALLOC_IN_TWICE            2    /* in malloc domain twice */
  1022. X#define MALLOC_BAD_ERRNO        3    /* bad errno value */
  1023. X
  1024. X/* pointer verification errors */
  1025. X#define MALLOC_POINTER_NULL        4    /* pointer is not in heap */
  1026. X#define MALLOC_POINTER_NOT_IN_HEAP    5    /* pointer is not in heap */
  1027. X#define MALLOC_POINTER_NOT_FOUND    6    /* pointer not-found */
  1028. X#define MALLOC_POINTER_FOUND        7    /* found special pointer */
  1029. X#define MALLOC_BAD_FILEP        8    /* bad bblock file-name */
  1030. X#define MALLOC_BAD_LINE            9    /* bad bblock line-number */
  1031. X#define MALLOC_UNDER_FENCE        10    /* failed picket fence lower */
  1032. X#define MALLOC_OVER_FENCE        11    /* failed picket fence upper */
  1033. X#define MALLOC_WOULD_OVERWRITE        12    /* would overwrite fence */
  1034. X
  1035. X/* allocation errors */
  1036. X#define MALLOC_BAD_SIZE            13    /* bad bblock size value */
  1037. X#define MALLOC_TOO_BIG            14    /* allocation too large */
  1038. X#define MALLOC_USER_NON_CONTIG        15    /* user space contig error */
  1039. X#define MALLOC_ALLOC_FAILED        16    /* could not get more space */
  1040. X#define MALLOC_BAD_SIZE_INFO        17    /* info doesn't match size */
  1041. X
  1042. X/* free errors */
  1043. X#define MALLOC_NOT_ON_BLOCK        18    /* not on block boundary */
  1044. X#define MALLOC_ALREADY_FREE        19    /* already in free list */
  1045. X#define MALLOC_NOT_START_USER        20    /* not start of user alloc */
  1046. X#define MALLOC_NOT_USER            21    /* not user allocated */
  1047. X#define MALLOC_BAD_FREE_LIST        22    /* free-list mess-up */
  1048. X#define MALLOC_FREE_NON_CONTIG        23    /* free space contig error */
  1049. X#define MALLOC_BAD_FREE_MEM        24    /* bad memory pointer */
  1050. X#define MALLOC_FREE_NON_BLANK        25    /* free space should be 0's */
  1051. X
  1052. X/* dblock errors */
  1053. X#define MALLOC_BAD_DBLOCK_SIZE        26    /* dblock bad size */
  1054. X#define MALLOC_BAD_DBLOCK_POINTER    27    /* bad dblock pointer */
  1055. X#define MALLOC_BAD_DBLOCK_MEM        28    /* bad memory pointer */
  1056. X#define MALLOC_BAD_DBADMIN_POINTER    29    /* bad dblock admin pointer */
  1057. X#define MALLOC_BAD_DBADMIN_MAGIC    30    /* bad dblock admin pointer */
  1058. X#define MALLOC_BAD_DBADMIN_SLOT        31    /* bad dblock slot info */
  1059. X
  1060. X/* administrative errors */
  1061. X#define MALLOC_BAD_ADMINP        32    /* out of bounds */
  1062. X#define MALLOC_BAD_ADMIN_LIST        33    /* out of bounds */
  1063. X#define MALLOC_BAD_ADMIN_MAGIC        34    /* bad magic numbers */
  1064. X#define MALLOC_BAD_ADMIN_COUNT        35    /* bad count number */
  1065. X#define MALLOC_BAD_BLOCK_ADMINP        36    /* bblock adminp bad */
  1066. X#define MALLOC_BAD_BLOCK_ADMINC        37    /* bblock adminp->count bad */
  1067. X
  1068. X/* heap check verification */
  1069. X#define MALLOC_BAD_BLOCK_ORDER        38    /* block allocation bad */
  1070. X#define MALLOC_BAD_FLAG            39    /* bad basic-block flag */
  1071. X
  1072. X#define IS_MALLOC_ERRNO(e)    ((e) >= MALLOC_NO_ERROR && \
  1073. X                 (e) <= MALLOC_BAD_FLAG)
  1074. X
  1075. X#endif /* ! __ERROR_VAL_H__ */
  1076. END_OF_FILE
  1077. if test 3812 -ne `wc -c <'error_val.h'`; then
  1078.     echo shar: \"'error_val.h'\" unpacked with wrong size!
  1079. fi
  1080. # end of 'error_val.h'
  1081. fi
  1082. if test -f 'malloc.info' -a "${1}" != "-c" ; then 
  1083.   echo shar: Will not clobber existing file \"'malloc.info'\"
  1084. else
  1085. echo shar: Extracting \"'malloc.info'\" \(41835 characters\)
  1086. sed "s/^X//" >'malloc.info' <<'END_OF_FILE'
  1087. XThis is Info file malloc.info, produced by Makeinfo-1.49 from the input
  1088. Xfile malloc.texi.
  1089. X
  1090. X   This file is an introduction to the Malloc library which handles
  1091. Xgeneral memory heap management.
  1092. X
  1093. X   Copyright (C) 1992 by Gray Watson and the Antaire Corporation.
  1094. X
  1095. X   Permission is granted to make and distribute verbatim copies of this
  1096. Xmanual provided the copyright notice and this permission notice are
  1097. Xpreserved on all copies.
  1098. X
  1099. X   Permission is granted to copy and distribute modified versions of
  1100. Xthis manual under the conditions for verbatim copying, provided also
  1101. Xthat the section entitled "Copying" are included exactly as in the
  1102. Xoriginal, and provided that the entire resulting derived work is
  1103. Xdistributed under the terms of a permission notice identical to this
  1104. Xone.
  1105. X
  1106. X   Permission is granted to copy and distribute translations of this
  1107. Xmanual into another language, under the above conditions for modified
  1108. Xversions, except that the section entitled "Copying" may be included in
  1109. Xa translation approved by the author instead of in the original English.
  1110. X
  1111. X
  1112. XFile: malloc.info,  Node: Top,  Next: Copying,  Prev: (dir),  Up: (dir)
  1113. X
  1114. XMalloc Debug Library
  1115. X********************
  1116. X
  1117. X   This file documents the general-usage and the inner-workings of the
  1118. Xmemory allocation or "malloc" library it accompanies.
  1119. X
  1120. X   This malloc library has been designed as a drop in replacement for
  1121. Xthe system's malloc, realloc, calloc, free and other memory management
  1122. Xroutines.  For more information about their capabilities, do a `man 3
  1123. Xmalloc' to read the system's manual pages.
  1124. X
  1125. X   What is unique about this library is that it contains a number of
  1126. Xpowerful debugging facilities including very comprehensive heap testing
  1127. Xand excellent run-time debugging information.  We have found these
  1128. Xcapabilities to be superb development tools.
  1129. X
  1130. X   I can be reached at `<gray.watson@antaire.com>' with any questions
  1131. Xor general comments.
  1132. X
  1133. X   Gray Watson, Antaire Corporation.
  1134. X
  1135. X* Menu:
  1136. X
  1137. X* Copying::             Library copying conditions.
  1138. X* Allocation Basics::   Basic description of terms and functions.
  1139. X* Features::            Description of the benefits of the library.
  1140. X* Usage::               How to run programs with the library.
  1141. X* Code::                Information on the source and general concerns.
  1142. X* Plugs::               A couple soapbox comments.
  1143. X
  1144. X
  1145. XFile: malloc.info,  Node: Copying,  Next: Allocation Basics,  Prev: Top,  Up: Top
  1146. X
  1147. XLibrary Copying Conditions.
  1148. X***************************
  1149. X
  1150. X   This package is covered by the GNU Library Public License.  See the
  1151. Xfile `COPYING-LIB' for details.  If you would like to do something with
  1152. Xthis package that you feel is reasonable but prohibited by the license,
  1153. Xplease contact me to see if we can work it out.
  1154. X
  1155. X   *NOTICE*: this is not the GNU Public License but the *library*
  1156. Xpublic license.  This license allows you to do more with the library
  1157. Xthan the standard public license distributed with most GNU software.
  1158. XPlease read `COPYING-LIB' or contact me for more information.
  1159. X
  1160. X   The rest of this section contains some messages from the Free
  1161. XSoftware Foundation.  If you find this stuff offensive or annoying,
  1162. Xremember that you probably did not spend any money to get this library
  1163. Xso feel free to heave it into the bit bucket.
  1164. X
  1165. X   The licenses for most software are designed to take away your
  1166. Xfreedom to share and change it.  By contrast, the GNU General Public
  1167. XLicenses are intended to guarantee your freedom to share and change
  1168. Xfree software--to make sure the software is free for all its users.
  1169. X
  1170. X   This license, the Library General Public License, applies to some
  1171. Xspecially designated Free Software Foundation software, and to any other
  1172. Xlibraries whose authors decide to use it.  You can use it for your
  1173. Xlibraries, too.
  1174. X
  1175. X   When we speak of free software, we are referring to freedom, not
  1176. Xprice. Our General Public Licenses are designed to make sure that you
  1177. Xhave the freedom to distribute copies of free software (and charge for
  1178. Xthis service if you wish), that you receive source code or can get it
  1179. Xif you want it, that you can change the software or use pieces of it in
  1180. Xnew free programs; and that you know you can do these things.
  1181. X
  1182. X   To protect your rights, we need to make restrictions that forbid
  1183. Xanyone to deny you these rights or to ask you to surrender the rights. 
  1184. XThese restrictions translate to certain responsibilities for you if you
  1185. Xdistribute copies of the library, or if you modify it.
  1186. X
  1187. X   For example, if you distribute copies of the library, whether gratis
  1188. Xor for a fee, you must give the recipients all the rights that we gave
  1189. Xyou. You must make sure that they, too, receive or can get the source
  1190. Xcode. If you link a program with the library, you must provide complete
  1191. Xobject files to the recipients so that they can relink them with the
  1192. Xlibrary, after making changes to the library and recompiling it.  And
  1193. Xyou must show them these terms so they know their rights.
  1194. X
  1195. X   Our method of protecting your rights has two steps: (1) copyright the
  1196. Xlibrary, and (2) offer you this license which gives you legal permission
  1197. Xto copy, distribute and/or modify the library.
  1198. X
  1199. X   Also, for each distributor's protection, we want to make certain that
  1200. Xeveryone understands that there is no warranty for this free library.
  1201. XIf the library is modified by someone else and passed on, we want its
  1202. Xrecipients to know that what they have is not the original version, so
  1203. Xthat any problems introduced by others will not reflect on the original
  1204. Xauthors' reputations.
  1205. X
  1206. X
  1207. XFile: malloc.info,  Node: Allocation Basics,  Next: Features,  Prev: Copying,  Up: Top
  1208. X
  1209. XBasic Description of Terms and Functions.
  1210. X*****************************************
  1211. X
  1212. X   This section provides a basic definition of terms used throughout the
  1213. Xmanual as well as a brief overview of the basic malloc functions and
  1214. Xexamples of their use.  It is quite unnecessary for you to read this
  1215. Xsection if you are familiar with using the heap allocation functions.
  1216. X
  1217. X* Menu:
  1218. X
  1219. X* Basic definitions::   For defining general terms and concepts.
  1220. X* Malloc functions::    Functionality supported by all malloc libs.
  1221. X
  1222. X
  1223. XFile: malloc.info,  Node: Basic definitions,  Next: Malloc functions,  Up: Allocation Basics
  1224. X
  1225. XFor Defining General Terms and Concepts.
  1226. X========================================
  1227. X
  1228. X   Any program can be divided into 2 logical parts: text and data. 
  1229. XText is the actual program code in machine-readable format and data is
  1230. Xthe information that the text operates on when it is executing.  The
  1231. Xdata, in turn, can be divided into 3 logical parts according to where
  1232. Xit is stored: "static", "stack", and "heap".
  1233. X
  1234. X   Static data is the information whose storage space is compiled into
  1235. Xthe program.
  1236. X             /* global variables are allocated as static data */
  1237. X             int numbers[10];
  1238. X     
  1239. X             main()
  1240. X             {
  1241. X                ...
  1242. X             }
  1243. X   Stack data is data allocated at run-time to hold information used
  1244. Xinside of functions.  This data is managed by the system in the space
  1245. Xcalled stack space.
  1246. X
  1247. X             void foo()
  1248. X             {
  1249. X                /* this local variable is allocated on the stack */
  1250. X                float total;
  1251. X     
  1252. X                ...
  1253. X             }
  1254. X   Heap data is also allocated at run-time and provides a programmer
  1255. Xwith dynamic memory capabilities.
  1256. X
  1257. X             main()
  1258. X             {
  1259. X                char * string;
  1260. X                ...
  1261. X     
  1262. X                /* allocate a string of 10 bytes */
  1263. X                string = (char *)malloc(10);
  1264. X                ...
  1265. X                /* de-allocate the string now that I'm done with it */
  1266. X                (void)free(string);
  1267. X     
  1268. X                ...
  1269. X             }
  1270. X   It is the heap data that is managed by this library.
  1271. X
  1272. X   Although the above is an example of how to use the malloc and free
  1273. Xcommands, it is not a good example of why using the heap for run-time
  1274. Xstorage is useful.
  1275. X
  1276. X   Consider this: You write a program that reads a file into memory,
  1277. Xprocesses it, and displays results.  You would like to handle files with
  1278. Xarbitrary size (from 10 bytes to 1.2 megabytes and more).  One problem,
  1279. Xhowever, is that the entire file must be in memory at one time to do the
  1280. Xcalculations.  You don't want to have to allocate 1.2 megabytes when you
  1281. Xmight only be reading in a 10 byte file because it is wasteful of system
  1282. Xresources.  Also, you are worried that your program might have to handle
  1283. Xfiles of more than 1.2 megabytes.
  1284. X
  1285. X   A solution: first checkout the file's size and then, using the
  1286. Xheap-allocation routines, get enough storage to read the entire file
  1287. Xinto memory.  The program will only be using the system resources
  1288. Xnecessary for the job and you will be guaranteed that your program can
  1289. Xhandle any sized file.
  1290. X
  1291. X
  1292. XFile: malloc.info,  Node: Malloc functions,  Prev: Basic definitions,  Up: Allocation Basics
  1293. X
  1294. XFunctionality Supported by all Malloc Libraries.
  1295. X================================================
  1296. X
  1297. X   All malloc libraries support 4 basic memory allocation commands. 
  1298. XThese include "malloc", "calloc", "realloc", and "free".
  1299. X
  1300. X`malloc'
  1301. X     Usage: `pnt = (type *)malloc(unsigned int size);'
  1302. X
  1303. X     The malloc routine is the basic memory allocation routine.  It
  1304. X     allocates an area of size bytes.  It will return a pointer to the
  1305. X     space requested.
  1306. X
  1307. X`calloc'
  1308. X     Usage: `pnt = (type *)calloc(unsigned int number, unsigned int
  1309. X     size);'
  1310. X
  1311. X     The calloc routine allocates a certain number of items, each of
  1312. X     size bytes, and returns a pointer to the space.  It is appropriate
  1313. X     to pass in a `sizeof(type)' value as the size argument.
  1314. X
  1315. X     Also, calloc nulls the space that it returns, assuring that the
  1316. X     memory is all zeros.
  1317. X
  1318. X`realloc'
  1319. X     Usage: `new_pnt = (type *)realloc(void * old_pnt, unsigned int
  1320. X     new_size);'
  1321. X
  1322. X     The realloc function expands or shrinks the memory allocation in
  1323. X     old_pnt to new_size number of bytes.  Realloc copies the
  1324. X     information in old_pnt into the new_pnt space up to new_size bytes
  1325. X     or until it copies all of the information from old_pnt.
  1326. X
  1327. X`free'
  1328. X     Usage: `(void)free(void * pnt);'
  1329. X
  1330. X     The free routine releases an allocation returned by malloc,
  1331. X     calloc, or realloc back to the heap.  This allows other parts of
  1332. X     the program to re-use memory that is not needed anymore.  It also
  1333. X     guarantees that the process does not grow too big and swallow a
  1334. X     large portion of the system resources.
  1335. X
  1336. X   *NOTE*: the returned address from the memory allocation/reallocation
  1337. Xfunctions should *always* be cast to the appropriate pointer type for
  1338. Xthe variable being assigned.
  1339. X
  1340. X   *WARNING*: there is a quite common myth that all of the space that
  1341. Xis returned by malloc libraries has already been cleared.  *Only* the
  1342. Xcalloc routine will zero the memory space it returns.
  1343. X
  1344. X
  1345. XFile: malloc.info,  Node: Features,  Next: Usage,  Prev: Allocation Basics,  Up: Top
  1346. X
  1347. XDescription of the Benefits of the Library.
  1348. X*******************************************
  1349. X
  1350. X* Menu:
  1351. X
  1352. X* Overview::                    General debugging concepts.
  1353. X* Environment variables::       The variable names and their features.
  1354. X* malloc_dbg program::          Env variable setting utility.
  1355. X* RC file::                     Format of the run-time configuration file.
  1356. X* Debug tokens::                Description of the debugging token flags.
  1357. X* Argument checking::           Special checking of function arguments.
  1358. X
  1359. X
  1360. XFile: malloc.info,  Node: Overview,  Next: Environment variables,  Up: Features
  1361. X
  1362. XGeneral Debugging Concepts.
  1363. X===========================
  1364. X
  1365. X   The features of this library are controlled by a number of
  1366. Xenvironmental variables.  They enable the memory debugging features at
  1367. Xruntime to help locate problems, chart memory leaks, provide basic
  1368. Xbounds checking, log statistics, etc.. *Note Environment variables::.
  1369. X
  1370. X   The debugging features that are available can be broken down into a
  1371. Xcouple basic classifications:
  1372. X
  1373. X`file and line number information'
  1374. X     One of the nice things about a good debugger is its ability to
  1375. X     provide the file and line number of an offending piece of code. 
  1376. X     This library attempts to give this functionality with the help of
  1377. X     "cpp", the C preprocessor.  If the file `malloc.h' is included,
  1378. X     the library can provide file and line information for the warning
  1379. X     messages and errors it generates.
  1380. X
  1381. X`fence-post (i.e. bounds) checking'
  1382. X     "Fence-post" memory is the area immediately above or below memory
  1383. X     allocations.  I have found it all to easy to write code that
  1384. X     accesses above or below an allocation (especially when dealing
  1385. X     with arrays or strings).  The library can write special values in
  1386. X     the areas around every allocation so it will notice when these
  1387. X     areas have been overwritten.
  1388. X
  1389. X     *NOTE*: The library cannot notice when the program reads from these
  1390. X     areas, only when it writes values.  Also, fence-post checking will
  1391. X     increase the amount of memory the program allocates.
  1392. X
  1393. X`heap-constancy verification'
  1394. X     The administration of the library is reasonably complex.  If any
  1395. X     of the heap-maintenance information is corrupted, the program will
  1396. X     either crash or give unpredictable results.
  1397. X
  1398. X     By enabling heap-consistency checking, the library will run
  1399. X     through its administrative structures to make sure all is in
  1400. X     order.  This will mean that problems will be caught faster and
  1401. X     diagnosed better.
  1402. X
  1403. X     The drawback of this is, of course, that the library often takes
  1404. X     quite a long time to do this.  It is suitable to enable this only
  1405. X     during development and debugging sessions.
  1406. X
  1407. X     *NOTE*: the heap checking routines cannot guarantee that the tests
  1408. X     will not cause a segmentation-fault if the heap administration
  1409. X     structures are properly (or improperly if you will) overwritten. 
  1410. X     In other words, they will verify that everything is okay but may
  1411. X     not inform the user of problems in a graceful manner.
  1412. X
  1413. X`logging statistics'
  1414. X     One of the initial reasons why I personally wanted malloc-debug
  1415. X     capabilities is to track my programs' memory usage; specifically to
  1416. X     locate memory "leaks" which are places where allocated memory is
  1417. X     never getting freed.
  1418. X
  1419. X     The library has a number of logging capabilities that can track
  1420. X     run-time memory usage, administrative actions, final program
  1421. X     statistics, as well as un-freed memory pointers.  This information
  1422. X     is also good at providing more general debugging feedback.
  1423. X
  1424. X`examining unfreed memory'
  1425. X     Another common problem with programs is that they free a memory
  1426. X     pointer but then use go on to use it again by mistake.  This can
  1427. X     lead to mysterious crashes and unexplained problems.
  1428. X
  1429. X     To combat this, the library can write special values into a block
  1430. X     of memory after it has been freed.  This serves two purposes: it
  1431. X     will make sure that the program will get garbage data if it trying
  1432. X     to access the area again, and it will allow the library to verify
  1433. X     the area later for signs of overwriting.
  1434. X
  1435. X   If any of the above debugging features detect an error, the library
  1436. Xwill try to recover.  If logging is enabled then an error will be
  1437. Xlogged with as much information as possible.
  1438. X
  1439. X   The error messages that the library displays are designed to give the
  1440. Xmost information for developers.  If the error message is not
  1441. Xunderstood, then it is most likely just trying to indicate that a part
  1442. Xof the heap has been corrupted.  The bug is most likely near the last
  1443. Xcall made to the library so reviewing the code around this area is
  1444. Xrecommended.
  1445. X
  1446. X   The library can be configured to quit immediately when an error is
  1447. Xdetected and to dump a core file or memory-image.  This can be examined
  1448. Xwith a debugger to determine the source of the problem.
  1449. X
  1450. X   When running our programs in a debugger such as gdb (the *excellent*
  1451. XGNU debugger), I always put a break-point in `_malloc_perror()' which
  1452. Xis the internal error routine for the library.  The program will then
  1453. Xhit the break-point as soon as a memory problem is detected.
  1454. X
  1455. X   Other malloc-debug libraries also support the ability to dump core
  1456. Xand then continue running.  I decided not to support this once it was
  1457. Xdetermined that some versions of `fork' make calls to malloc which
  1458. Xwould cause the library to go recursive.
  1459. X
  1460. X   *NOTE*: do not be surprised if the library catches problems with
  1461. Xyour system's library routines.  It took me four hours once to finally
  1462. Xcome to the conclusion that the localtime call, included in SunOS
  1463. Xrelease 4.1, was overwriting one of its fence-post markers.
  1464. X
  1465. X
  1466. XFile: malloc.info,  Node: Environment variables,  Next: malloc_dbg program,  Prev: Overview,  Up: Features
  1467. X
  1468. XEnvironment Variables - Their Names and Features.
  1469. X=================================================
  1470. X
  1471. X   "Environment variables" are variables that are part of the user's
  1472. Xworking environment and are shared by all the programs.  The below
  1473. Xvariables are used by the malloc library to enable or disable the memory
  1474. Xdebugging features, at runtime.
  1475. X
  1476. X   They can be set either by hand or with the help of the malloc_dbg
  1477. Xprogram.  *Note malloc_dbg program::.
  1478. X
  1479. X   To set them by hand, C shell (or tcsh) users need to invoke:
  1480. X
  1481. X             setenv variable value;
  1482. X   Bourne shell (or bash, ksh) users should use:
  1483. X
  1484. X             variable=value;
  1485. X             export variable;
  1486. X
  1487. X`MALLOC_DEBUG'
  1488. X     This env variable should be set to a value in hexadecimal which
  1489. X     corresponds to a set of functionality tokens.  *Note Debug
  1490. X     tokens::.  For instance, if the user wanted to enabled logging of
  1491. X     memory transactions (value `0x008') and wanted to check fence-post
  1492. X     memory (value `0x400') then `MALLOC_DEBUG' should be set to
  1493. X     `0x408'.
  1494. X
  1495. X     Don't worry about remembering all the hex values of the tokens, the
  1496. X     malloc_dbg program automates the setting of this variable
  1497. X     especially.
  1498. X
  1499. X`MALLOC_LOGFILE'
  1500. X     Set this variable to a filename so that if `MALLOC_DEBUG' has
  1501. X     logging enabled, the library can log transactions, administration
  1502. X     information, and/or errors to the file so memory problems and
  1503. X     usage can be tracked.
  1504. X
  1505. X`MALLOC_ADDRESS'
  1506. X     When this env variable is set to a hex address (taken from the
  1507. X     malloc log-file for instance) malloc will abort when it finds
  1508. X     itself either allocating or freeing that address.
  1509. X
  1510. X     The address can also have an `:number' argument.  For instance, if
  1511. X     it was set it to `0x3e45:10', the library will kill itself the 10th
  1512. X     time it sees address `0x3e45'.
  1513. X
  1514. X     This makes it easier to track down specific addresses not being
  1515. X     freed.
  1516. X
  1517. X`MALLOC_INTERVAL'
  1518. X     By setting this env variable to a number X, malloc will only check
  1519. X     the heap every X times.  This means a number of `MALLOC_DEBUG'
  1520. X     features can be enabled while still running the program within a
  1521. X     finite amount of time.
  1522. X
  1523. X     I have found that a setting of `100' works well with reasonably
  1524. X     memory intensive programs.  This of course means that the library
  1525. X     will not catch errors exactly when they happen but possibly 100
  1526. X     library calls later.
  1527. X
  1528. X`MALLOC_START'
  1529. X     Set this env variable to a number X and malloc will begin checking
  1530. X     the heap after X times.  This means the intensive debugging can be
  1531. X     started after a certain point in a program.
  1532. X
  1533. X     `MALLOC_START' also has the format file:line.  For instance, if it
  1534. X     is set to `malloc_t.c:126' malloc will start checking the heap
  1535. X     after it sees a malloc call from the `malloc_t.c' file, line number
  1536. X     126.  If line number is 0 then malloc will start checking the heap
  1537. X     after it sees a call from anywhere in the `malloc_t.c' file.
  1538. X
  1539. X     This allows the intensive debugging to be started after a certain
  1540. X     routine or file has been reached in the program.
  1541. X
  1542. X
  1543. XFile: malloc.info,  Node: malloc_dbg program,  Next: RC file,  Prev: Environment variables,  Up: Features
  1544. X
  1545. XEnv Variable Setting Utility.
  1546. X=============================
  1547. X
  1548. X   The malloc_dbg program is designed to assist in the setting of the
  1549. Xenvironmental variables, especially `MALLOC_DEBUG'. *Note Environment
  1550. Xvariables::.  It is designed to print the shell commands necessary to
  1551. Xmake the appropriate changes to the environment. Unfortunately, it
  1552. Xcannot make the changes on its own so the output from malloc_dbg should
  1553. Xbe sent through the `eval' shell command which will do the commands.
  1554. X
  1555. X   With shells that have aliasing or macro capabilities: csh, tcsh,
  1556. Xbash, ksh, etc., setting up an alias to malloc_dbg to do the eval call
  1557. Xis recommended.  csh/tcsh users (for example) should put the following
  1558. Xin their `.cshrc' file:
  1559. X
  1560. X             alias malloc 'eval `malloc_dbg \!*`'
  1561. X   This allows the user to execute `malloc args'.
  1562. X
  1563. X   The most basic usage for the program is `malloc_dbg [-b] tag'.  The
  1564. X-b flag is for generating Bourne-shell type commands (C-shell type are
  1565. Xthe default).  The tag argument should match a line from the user's
  1566. Xrun-time configuration file.  *Note RC file::.
  1567. X
  1568. X   Here is a detailed list of the flags that can passed to malloc_dbg:
  1569. X
  1570. X`-a address'
  1571. X     Set the `MALLOC_ADDRESS' variable with the string address (or
  1572. X     alternatively address:number).
  1573. X
  1574. X`-b'
  1575. X     Output Bourne-shell type commands.  (C-shell type output is the
  1576. X     default).
  1577. X
  1578. X`-c'
  1579. X     Clear/unset all of the variables not specified with other
  1580. X     arguments.
  1581. X
  1582. X     *NOTE*: clear will never unset the `MALLOC_DEBUG' variable. Use
  1583. X     `-d 0' or a tag to `none' to achieve this.
  1584. X
  1585. X`-d bitmask'
  1586. X     Set the MALLOC_DEBUG to the bitmask value which should be in hex. 
  1587. X     This is overridden (and unnecessary) if a tag is specified.
  1588. X
  1589. X`-e errno'
  1590. X     Print the malloc error string that corresponds to errno.
  1591. X
  1592. X`-f filename'
  1593. X     Use this configuration file instead of the RC file
  1594. X     `$HOME/.mallocrc'.
  1595. X
  1596. X`-i number'
  1597. X     Set the `MALLOC_INTERVAL' env variable to number.
  1598. X
  1599. X`-l filename'
  1600. X     Set the `MALLOC_LOGFILE' env variable to filename.
  1601. X
  1602. X`-s number'
  1603. X     Set the `MALLOC_START' env variable to number (alternatively
  1604. X     file:line).
  1605. X
  1606. X   If no arguments are specified, malloc_dbg dumps out the current
  1607. Xsettings that you have for the malloc environmental variables.  For
  1608. Xexample:
  1609. X
  1610. X             MALLOC_DEBUG == '0x6417' (debug1)
  1611. X             MALLOC_ADDRESS == '0'
  1612. X             MALLOC_INTERVAL not set
  1613. X             MALLOC_LOGFILE == 'malloc'
  1614. X             MALLOC_START not set
  1615. X
  1616. X
  1617. XFile: malloc.info,  Node: RC file,  Next: Debug tokens,  Prev: malloc_dbg program,  Up: Features
  1618. X
  1619. XFormat of the Run-Time Configuration File.
  1620. X==========================================
  1621. X
  1622. X   The name of default "RC file" (or run-time configuration file) is
  1623. X`$HOME/.mallocrc'.  The `$HOME' environmental variable should be set by
  1624. Xthe system to point to your home-directory.
  1625. X
  1626. X   The rc file file should contain lines in the general form of:
  1627. X
  1628. X   `tag token1, token2, ...'
  1629. X
  1630. X   tag is to be matched with the tag argument passed to the malloc_dbg
  1631. Xprogram, token1, token2, ... are debug capability tokens. *Note
  1632. Xmalloc_dbg program:: and *Note Debug tokens::.
  1633. X
  1634. X   A line can be finished with a '\' meaning it continues onto the next
  1635. Xline.  Lines beginning with '#' are treated as comments and are ignored
  1636. Xalong with empty lines.
  1637. X
  1638. X   I have the below contents in my `.mallocrc' file:
  1639. X
  1640. X     #
  1641. X     # Malloc run-time configuration file for our malloc-debug library
  1642. X     #
  1643. X     
  1644. X     # no debugging
  1645. X     none    none
  1646. X     
  1647. X     # basic debugging
  1648. X     debug1    log-stats, log-non-free, log-perror, log-bad-pnt, check-fence
  1649. X     
  1650. X     # more logging and some heap checking
  1651. X     debug2    log-stats, log-non-free, log-perror, log-trans, log-bad-pnt, \
  1652. X         check-fence, check-heap, check-lists, error-abort
  1653. X     
  1654. X     # good utilities
  1655. X     debug3    log-stats, log-non-free, log-perror, log-trans, log-bad-pnt, \
  1656. X         log-admin, check-fence, check-heap, check-lists, realloc-copy, \
  1657. X         free-blank, error-abort
  1658. X     
  1659. X     ...
  1660. X   With the above file, when I say `eval `malloc_dbg debug1`', I enable
  1661. Xthe logging of statistics, the logging of non-freed memory, logging of
  1662. Xerrors, logging of bad pointer information, and the checking of
  1663. Xfence-post memory areas.
  1664. X
  1665. X   When I say `eval `malloc_dbg none`', all memory debugging features
  1666. Xare disabled.
  1667. X
  1668. X
  1669. XFile: malloc.info,  Node: Debug tokens,  Next: Argument Checking,  Prev: RC file,  Up: Features
  1670. X
  1671. XDescription of the Debugging Token Flags.
  1672. X=========================================
  1673. X
  1674. X   The below tokens and their corresponding descriptions are for the
  1675. Xsetting of the `MALLOC_DEBUG' environmental variable *Note Environment
  1676. Xvariables::.  They should be specified in the user's `.mallocrc' file
  1677. X*Note RC file::.
  1678. X
  1679. X`none'
  1680. X     no debugging functionality
  1681. X
  1682. X`log-stats'
  1683. X     log general statistics when malloc_shutdown is called
  1684. X
  1685. X`log-non-free'
  1686. X     log non-freed memory pointers when malloc_shutdown is called
  1687. X
  1688. X`log-perror'
  1689. X     log internal error-messages
  1690. X
  1691. X`log-trans'
  1692. X     log general memory transactions
  1693. X
  1694. X`log-bad-pnt'
  1695. X     log information about bad-pointers
  1696. X
  1697. X`log-admin'
  1698. X     log full administrative information
  1699. X
  1700. X`log-blocks'
  1701. X     log detailed block information when malloc_heap_map is called
  1702. X
  1703. X`log-unknown'
  1704. X     like log-non-free but logs unknown non-freed memory pointers
  1705. X
  1706. X`check-fence'
  1707. X     check fence-post memory areas
  1708. X
  1709. X`check-heap'
  1710. X     verify heap administrative structure
  1711. X
  1712. X`check-lists'
  1713. X     examine internal heap linked-lists
  1714. X
  1715. X`check-dblock'
  1716. X     do detailed checking on small allocations
  1717. X
  1718. X`check-dblock-fence'
  1719. X     check the fence-post areas of small allocations
  1720. X
  1721. X`check-free'
  1722. X     check to see if free space has been overwritten
  1723. X
  1724. X`check-funcs'
  1725. X     check the arguments of some functions (mostly string operations)
  1726. X     looking for bad pointers
  1727. X
  1728. X`realloc-copy'
  1729. X     always copy data to a new pointer when realloc
  1730. X
  1731. X`free-blank'
  1732. X     write special values (non-0) into space when it is freed
  1733. X
  1734. X`error-abort'
  1735. X     abort the program (and dump core) on errors
  1736. X
  1737. X`alloc-blank'
  1738. X     write special values (non-0) into space when it is alloced
  1739. X
  1740. X`heap-check-map'
  1741. X     log a heap-map to the logfile every time the heap is checked
  1742. X
  1743. X`print-perror'
  1744. X     log any errors and messages to the screen via standard-error
  1745. X
  1746. X
  1747. XFile: malloc.info,  Node: Argument Checking,  Prev: Debug tokens,  Up: Features
  1748. X
  1749. XCheck Certain Function Arguments.
  1750. X=================================
  1751. X
  1752. X   One potential problem with the library and its multitude of checks
  1753. Xand diagnoses is that they only get performed when a malloc function is
  1754. Xcalled.  One solution this is to include `malloc.h' and compile your
  1755. Xsource code with the `MALLOC_FUNC_CHECK' flag defined and enable the
  1756. X`check-funcs' token *Note Debug tokens::.
  1757. X
  1758. X             gcc -DMALLOC_FUNC_CHECK file.c
  1759. X   Once you have compiled your source with FUNC_CHECK enabled, you will
  1760. Xhave to recompile with it off to disconnect the library *Note Disabling
  1761. Xthe Library::.
  1762. X
  1763. X   When this is defined malloc will override a number of functions and
  1764. Xwill insert a routine which knowns how to check its own arguments and
  1765. Xthen call the real function.  Malloc can check such functions as bcopy,
  1766. Xindex, strcat, and strcasecmp (for the full list see the end of
  1767. X`malloc.h').
  1768. X
  1769. X   When you call strlen, for instance, malloc will make sure the string
  1770. Xargument's fence-post areas have not been overwritten, its file and line
  1771. Xnumber locations are good, etc.  With bcopy, malloc will make sure that
  1772. Xthe destination string has enough space to store the number of bytes
  1773. Xspecified.
  1774. X
  1775. X   For all of the arguments checked, if the pointer is not in the heap
  1776. Xthen it is ignored since malloc does know anything about it.
  1777. X
  1778. X   *NOTE*: this is one of the newest parts of the library so problems
  1779. Xmay still be lurking.
  1780. X
  1781. X
  1782. XFile: malloc.info,  Node: Usage,  Next: Code,  Prev: Features,  Up: Top
  1783. X
  1784. XHow to Run Programs With the Library.
  1785. X*************************************
  1786. X
  1787. X* Menu:
  1788. X
  1789. X* Allocation macros::           For providing file and line information.
  1790. X* Extensions::                  Additional non-standard routines.
  1791. X* Disabling the Library::       How to compile/link without the library.
  1792. X
  1793. X
  1794. XFile: malloc.info,  Node: Allocation macros,  Next: Extensions,  Up: Usage
  1795. X
  1796. XFor Providing File/Line Debugging Information.
  1797. X==============================================
  1798. X
  1799. X   By including `malloc.h' in your C files, your calls to calloc, free,
  1800. Xmalloc, or realloc are replaced with calls to _calloc_leap, _free_leap,
  1801. X_malloc_leap, and _realloc_leap.
  1802. X
  1803. X   These leap macros use the c-preprocessor `__FILE__' and `__LINE__'
  1804. Xmacros which get replaced at compilation time with the current file and
  1805. Xline-number of the source code in question.  The leap routines take
  1806. Xthis information and pass it on to the library making it able to
  1807. Xproduce verbose reports on memory not freed:
  1808. X
  1809. X         not freed: 0x38410 ( 22 bytes) from 'malloc_t.c:92'
  1810. X             not freed: 0x38600 ( 10232 bytes) from 'malloc_t.c:104'
  1811. X   These lines from a log file shows that two allocations were not
  1812. Xfreed. One at address 0x38410 of size 22 bytes in source file
  1813. X`malloc_t.c' at line 92 and another at address 0x38600 of size 10232
  1814. Xbytes at line 104 of `malloc_t.c'.
  1815. X
  1816. X   Along with the above leap macros, `malloc.h' also contains the
  1817. Xfollowing macros which I have been using for all our memory allocation
  1818. Xneeds for some time now.  They take care of all the type-casting and
  1819. Xmake the code look much cleaner (IMHO).
  1820. X
  1821. X`ALLOC(type, count)'
  1822. X     Usage: `long_pnt = ALLOC(long, 30);'.  This means allocate space
  1823. X     for 30 longs.
  1824. X
  1825. X`MALLOC(size)'
  1826. X     Usage: `char_pnt = MALLOC(1000);'.  This is like ALLOC but for
  1827. X     characters only.  It means allocate space for 1000 characters.
  1828. X
  1829. X`CALLOC(type, count)'
  1830. X     Usage: `infp = CALLOC(struct info_st, 100);'.  This means allocate
  1831. X     space for 100 info_st structures and zero them all.
  1832. X
  1833. X     *NOTE*: the arguments for the CALLOC macro are sort of reversed
  1834. X     from calloc(unsigned int count, unsigned int size).
  1835. X
  1836. X`REALLOC(pnt, type, count)'
  1837. X     Usage: `long_pnt = REALLOC(old_pnt, long, 10);'.  This takes
  1838. X     old_pnt and and changes its size to accommodate 10 longs.
  1839. X
  1840. X`REMALLOC(pnt, size)'
  1841. X     Usage: `char_pnt = REMALLOC(char_pnt, 100);'.  This is like REALLOC
  1842. X     but for characters only.  It takes char_pnt and changes its size
  1843. X     to 100 characters.
  1844. X
  1845. X`FREE(pnt)'
  1846. X     Usage: `(void)FREE(pnt);'.  This frees memory pointers.
  1847. X
  1848. X`STRDUP(string)'
  1849. X     Usage: `char_pnt = STRDUP("hello");'.  This macro duplicates the
  1850. X     functionality of the `strdup' function.  string can be either a
  1851. X     static string like "hello" or a character pointer.  Non-gcc users
  1852. X     should use `STRDUP("hello", char_pnt);' where char_pnt is the
  1853. X     variable which will be assigned to the pointer to the copy of
  1854. X     "hello".
  1855. X
  1856. X`BDUP(pnt, size)'
  1857. X     Usage: `new_item_pnt = BDUP(&item, sizeof(item));'.  This allocates
  1858. X     space for size bytes, copies size bytes from pnt into the new
  1859. X     allocation and returns it.  It is like strdup but for non-strings.
  1860. X      Non-gcc users should use `BDUP(&item, sizeof(item),
  1861. X     new_item_pnt);' where new_item_pnt is the variable which will be
  1862. X     assigned the pointer to the copy of item.
  1863. X
  1864. X   In the above macro list, I have also included a STRDUP and a BDUP
  1865. Xmacro. STRDUP, for those who are not familiar with the strdup function,
  1866. Xtakes a string, allocates enough information to store the string (along
  1867. Xwith its null character), and then copies the string into the new
  1868. Xspace.  This macro does not actually call strdup but provides the same
  1869. Xfunctionality and provides file and line memory information to the
  1870. Xlibrary.
  1871. X
  1872. X   BDUP is a function that I invented.  I use it to duplicate
  1873. Xstructures or other elements that are not strings.  A pointer to an
  1874. Xelement and its size are passed in and the macro returns an allocated
  1875. Xcopy of it.
  1876. X
  1877. X   gcc (GNUs c-compiler) has a neat feature in that it understands
  1878. Xreturn-values from macros.  I have included a gcc form of these 2 macros
  1879. X(which makes them a lot more functional) as well as a non-gcc version.
  1880. X
  1881. X   *NOTE*: I would like to strongly recommend the usage of gcc.  It is
  1882. Xa superior compiler and future releases of this library may require its
  1883. Xuse.
  1884. X
  1885. X
  1886. XFile: malloc.info,  Node: Extensions,  Next: Disabling the Library,  Prev: Allocation macros,  Up: Usage
  1887. X
  1888. XAdditional Non-Standard Routines.
  1889. X=================================
  1890. X
  1891. X   The library has a number of variables and routines that are not a
  1892. Xstandard part of most malloc libraries:
  1893. X
  1894. X`char * malloc_logpath;'
  1895. X     This variable can be used to set the malloc log filename.  The env
  1896. X     variable MALLOC_LOGFILE overrides this variable.
  1897. X
  1898. X`int malloc_errno;'
  1899. X     This variable stores the internal malloc library error number like
  1900. X     errno does for the system calls.  It can be passed to
  1901. X     `malloc_strerror()' (see below) to get a string version of the
  1902. X     error.  It will have a value of zero if the library has not
  1903. X     detected any problems.
  1904. X
  1905. X`void malloc_shutdown(void);'
  1906. X     This routine shuts the library down and logs the final statistics
  1907. X     and information especially the non-freed memory pointers.  It
  1908. X     should be run right before `exit()' or as the last function in
  1909. X     `main()'.
  1910. X
  1911. X                  main()
  1912. X                  {
  1913. X                          ...
  1914. X                          malloc_shutdown();
  1915. X                          exit(0);
  1916. X                  }
  1917. X
  1918. X`int malloc_heap_map(void);'
  1919. X     This routine will log to the logfile (if it is enabled) a graphical
  1920. X     representation of the current heap space.  It needs some work but
  1921. X     should provide some good information.
  1922. X
  1923. X`int malloc_verify(char * pnt);'
  1924. X     Use `malloc_verify' to verify individual memory pointers that are
  1925. X     suspect of memory problems.  To check the entire heap pass in a
  1926. X     NULL or 0 pointer.
  1927. X
  1928. X     *NOTE*: `malloc_verify' can only check the heap with the functions
  1929. X     that have been enabled.  For example, if fence-post checking is
  1930. X     not enabled in the `MALLOC_DEBUG' variable, `malloc_verify' cannot
  1931. X     check the fence-post areas in the heap.
  1932. X
  1933. X`int malloc_debug(long debug);'
  1934. X     With this routine, the value in the `MALLOC_DEBUG' variable can be
  1935. X     overridden and the library debugging features set explicitly.  For
  1936. X     instance, if debugging should never be enabled for a program, a
  1937. X     call to `malloc_debug(0);' as the first call in `main()' will
  1938. X     disable all the memory debugging from that point on.
  1939. X
  1940. X     One problem however is that some compilers (gcc for instance) make
  1941. X     calls to memory allocation functions *before* `main()' is reached
  1942. X     and `malloc_debug()' called meaning some debugging information may
  1943. X     be generated regardless.
  1944. X
  1945. X`int malloc_examine(char * pnt, int * size, char ** file, int * line);'
  1946. X     This routine provides some very interesting functionality.  It
  1947. X     returns the size of a pnt's allocation as well as the file and
  1948. X     line from which it was allocated.
  1949. X
  1950. X     *NOTE*: This function is *certainly* not portable and is not
  1951. X     provided by other malloc libraries.
  1952. X
  1953. X`char * malloc_strerror(int errnum);'
  1954. X     `malloc_strerror' returns the string representation of the error
  1955. X     value in errnum (which probably should be malloc_errno).  This
  1956. X     allows the logging of more verbose memory error messages.
  1957. X
  1958. X     You can also display the string representation of an error value
  1959. X     by a call to the `malloc_dbg' program with a `-e #' option *Note
  1960. X     malloc_dbg program::.
  1961. X
  1962. X
  1963. XFile: malloc.info,  Node: Disabling the Library,  Prev: Extensions,  Up: Usage
  1964. X
  1965. XHow to Compile/Link Without the Library.
  1966. X========================================
  1967. X
  1968. X   When you are finished with the development and debugging sessions,
  1969. Xyou may want to disable the malloc-debug library and put in its place
  1970. Xeither the system's memory-allocation routines, gnu-malloc, or maybe
  1971. Xyour own. I have tried to make this a reasonably painless process.  The
  1972. Xease of the extraction depends heavily on how many of the library's
  1973. Xfeatures your made use of during your coding.
  1974. X
  1975. X   I am open to any reasonable suggestions as to how to improve this
  1976. Xprocess while maintaining the effectiveness of the debugging.
  1977. X
  1978. X   * If you compiled any of your source modules with `MALLOC_FUNC_CHECK'
  1979. X     defined then you must first recompile all those modules without
  1980. X     the flag enabled.
  1981. X
  1982. X   * If you are using any of the special functions provided by the
  1983. X     malloc-debug library (such as `malloc_shutdown()'), then you will
  1984. X     need to `#ifdef', remove, or comment them out of your code.
  1985. X
  1986. X   * If you want to *totally* disable the malloc-debug library then you
  1987. X     will need to recompile all the C files that include `malloc.h'
  1988. X     while defining `MALLOC_DEBUG_DISABLE'.  This will cause the malloc
  1989. X     leap macros to not be applied *Note Allocation macros::.
  1990. X
  1991. X                  gcc -O -g -DMALLOC_DEBUG_DISABLE main.c
  1992. X
  1993. X   * Now you are ready to relink with a new library.  If you have not
  1994. X     compiled all your source with `MALLOC_DEBUG_DISABLED' defined then
  1995. X     you need to include the `malloc_lp.o' file on the link line.
  1996. X
  1997. X                  gcc -O -g main.o malloc_lp.o -L/usr/local/lib -lgmalloc
  1998. X     If you have disabled malloc with the `MALLOC_DEBUG_DISABLED' flag
  1999. X     or never included `malloc.h' in any of your C files, then you will
  2000. X     not need to include the `malloc_lp.o' file on the link line.
  2001. X
  2002. X                  gcc -O -g main.o -L/usr/local/lib -lgmalloc
  2003. X     If you get unresolved references like `_malloc_leap' or
  2004. X     `_malloc_bcopy' then something was not disabled as it should have
  2005. X     been.
  2006. X
  2007. X
  2008. XFile: malloc.info,  Node: Code,  Next: Plugs,  Prev: Usage,  Up: Top
  2009. X
  2010. XInformation on the Source and General Concerns.
  2011. X***********************************************
  2012. X
  2013. X* Menu:
  2014. X
  2015. X* Definitions::         Some terms and other information.
  2016. X* Compatibility::       General compatibility concerns.
  2017. X* Portability::         Issues important for porting the library.
  2018. X
  2019. X
  2020. XFile: malloc.info,  Node: Definitions,  Next: Compatibility,  Up: Code
  2021. X
  2022. XSome Terms and Other Information.
  2023. X=================================
  2024. X
  2025. X   Here are a couple definitions and other information for those
  2026. Xinterested in "picking the brain" of the library.  The code is a little
  2027. Xugly here and there and it conforms to the Gray-Watson handbook of
  2028. Xcoding standards only.
  2029. X
  2030. X"bblock"
  2031. X     basic block containing 2 ^ BASIC_BLOCK bytes of info
  2032. X
  2033. X"bblock_adm"
  2034. X     administration for a set of basic blocks
  2035. X
  2036. X"dblock"
  2037. X     divided block containing some base 2 number of blocks smaller than
  2038. X     a basic block.
  2039. X
  2040. X"dblock_adm"
  2041. X     administration for a set of divided blocks
  2042. X
  2043. X"chunk"
  2044. X     some anonymous amount of memory
  2045. X
  2046. X
  2047. XFile: malloc.info,  Node: Compatibility,  Next: Portability,  Prev: Definitions,  Up: Code
  2048. X
  2049. XGeneral Compatibility Concerns.
  2050. X===============================
  2051. X
  2052. X   * Realloc() backwards compatibility with being able to realloc from
  2053. X     the last freed block is *not* supported.
  2054. X
  2055. X   * Realloc() of a NULL pointer is supported in which case the library
  2056. X     will just make a call to malloc().  This is a compilation option
  2057. X     in the `conf.h' file.
  2058. X
  2059. X   * The library does *not* provide memalign() nor valloc() support as
  2060. X     of yet, but may in future releases.  I would be interested to know
  2061. X     who is using these functions, which architectures they are
  2062. X     supported on, and for what reason they are being used.
  2063. X
  2064. X   * Aside from possibly being slower than the system's memory
  2065. X     allocation functions, the library should be fully compatible with
  2066. X     the standard memory routines.  If this is *not* the case please
  2067. X     bring this to my attention.
  2068. X
  2069. X
  2070. XFile: malloc.info,  Node: Portability,  Prev: Compatibility,  Up: Code
  2071. X
  2072. XIssues Important for Porting the Library.
  2073. X=========================================
  2074. X
  2075. X   General compatibility issues center around:
  2076. X
  2077. X   * sbrk or compatible function usages
  2078. X
  2079. X   * Whether the systems's heap grows towards high or low memory.  The
  2080. X     chunk.c code is designed (loosely) around the fact that consecutive
  2081. X     calls to sbrk should give higher memory addresses.
  2082. X
  2083. X     I have not been able to test the library on a system whose heap
  2084. X     grows towards low memory.  If you are trying to run the library on
  2085. X     such a system I would be interested in talking with you.
  2086. X
  2087. X
  2088. XFile: malloc.info,  Node: Plugs,  Prev: Code,  Up: Top
  2089. X
  2090. XSoapbox Comments.
  2091. X*****************
  2092. X
  2093. X   Since I have your attention I would like to talk for a second about a
  2094. Xcouple of things that I feel strongly about.  If you would like any more
  2095. Xinformation about the below, please mail to the supplied addresses or
  2096. Xdrop me a line with any questions.
  2097. X
  2098. X`The Free Software Foundation <gnu@prep.ai.mit.edu>'
  2099. X     As you should be able to tell by now, I am a FSF supporter.  The
  2100. X     FSF's goal, as I see and support it, is to encourage the exchange
  2101. X     of free source code.  The organization and its individuals have
  2102. X     volunteered an amazing amount of time toward this.  If you use
  2103. X     emacs, gcc, gdb, patch, perl, bison, or any of their many programs
  2104. X     and libraries then you have benefited from the movement.  Please
  2105. X     consider supporting it.
  2106. X
  2107. X`Berkeley Software Design, Inc. <bsdi-info@bsdi.com>'
  2108. X     We at the Antaire Corporation are the proud and enthusiastic
  2109. X     owners of the BSD/386 operating system.  For $1k you get a
  2110. X     *complete* BSD-flavor operating system with *full source* for 386
  2111. X     and 486 systems (binary licenses are available).  Along with the
  2112. X     obvious benefits of full source code come excellent customer
  2113. X     support/service and system features such as a MS-DOG runtime
  2114. X     environment, complete tcp/ip networking facilities including nfs,
  2115. X     full software development utilities, X, etc.
  2116. X
  2117. X
  2118. X
  2119. XTag Table:
  2120. XNode: Top1056
  2121. XNode: Copying2320
  2122. XNode: Allocation Basics5479
  2123. XNode: Basic definitions6079
  2124. XNode: Malloc functions8689
  2125. XNode: Features10723
  2126. XNode: Overview11324
  2127. XNode: Environment variables16472
  2128. XNode: malloc_dbg program19671
  2129. XNode: RC file22230
  2130. XNode: Debug tokens24054
  2131. XNode: Argument Checking25962
  2132. XNode: Usage27456
  2133. XNode: Allocation macros27830
  2134. XNode: Extensions31857
  2135. XNode: Disabling the Library35092
  2136. XNode: Code37188
  2137. XNode: Definitions37547
  2138. XNode: Compatibility38256
  2139. XNode: Portability39208
  2140. XNode: Plugs39861
  2141. X
  2142. XEnd Tag Table
  2143. END_OF_FILE
  2144. echo shar: 44 control characters may be missing from \"'malloc.info'\"
  2145. if test 41835 -ne `wc -c <'malloc.info'`; then
  2146.     echo shar: \"'malloc.info'\" unpacked with wrong size!
  2147. fi
  2148. # end of 'malloc.info'
  2149. fi
  2150. echo shar: End of archive 3 \(of 5\).
  2151. cp /dev/null ark3isdone
  2152. MISSING=""
  2153. for I in 1 2 3 4 5 ; do
  2154.     if test ! -f ark${I}isdone ; then
  2155.     MISSING="${MISSING} ${I}"
  2156.     fi
  2157. done
  2158. if test "${MISSING}" = "" ; then
  2159.     echo You have unpacked all 5 archives.
  2160.     echo "Do a 'sh ./configure' to configure the library"
  2161.     rm -f ark[1-9]isdone
  2162. else
  2163.     echo You still need to unpack the following archives:
  2164.     echo "        " ${MISSING}
  2165. fi
  2166. ##  End of shell archive.
  2167. exit 0
  2168.