home *** CD-ROM | disk | FTP | other *** search
open in:
MacOS 8.1
|
Win98
|
DOS
browse contents |
view JSON data
|
view as text
This file was processed as: SHell self-extracting ARchive
(archive/shar).
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| dexvert
| SHell self-extracting ARchive (archive/shar)
| magic
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| ASCII text
| default
| |
100%
| checkBytes
| Printable ASCII
| default
| |
100%
| perlTextCheck
| Likely Text (Perl)
| default
| |
100%
| siegfried
| fmt/329 Shell Archive Format
| default
| |
100%
| detectItEasy
| Format: plain text[LF]
| default (weak)
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 4e 65 77 73 67 72 6f 75 | 70 73 3a 20 63 6f 6d 70 |Newsgrou|ps: comp|
|00000010| 2e 73 6f 75 72 63 65 73 | 2e 6d 69 73 63 0a 46 72 |.sources|.misc.Fr|
|00000020| 6f 6d 3a 20 63 70 63 61 | 68 69 6c 40 76 74 69 2e |om: cpca|hil@vti.|
|00000030| 63 6f 6d 20 28 43 6f 6e | 6f 72 20 50 2e 20 43 61 |com (Con|or P. Ca|
|00000040| 68 69 6c 6c 29 0a 53 75 | 62 6a 65 63 74 3a 20 20 |hill).Su|bject: |
|00000050| 76 33 32 69 30 31 30 3a | 20 20 64 62 6d 61 6c 6c |v32i010:| dbmall|
|00000060| 6f 63 20 2d 20 44 65 62 | 75 67 20 4d 61 6c 6c 6f |oc - Deb|ug Mallo|
|00000070| 63 20 4c 69 62 72 61 72 | 79 20 50 4c 31 34 2c 20 |c Librar|y PL14, |
|00000080| 50 61 72 74 30 35 2f 31 | 30 0a 4d 65 73 73 61 67 |Part05/1|0.Messag|
|00000090| 65 2d 49 44 3a 20 3c 31 | 39 39 32 53 65 70 34 2e |e-ID: <1|992Sep4.|
|000000a0| 31 35 32 31 34 32 2e 31 | 33 32 36 34 40 73 70 61 |152142.1|3264@spa|
|000000b0| 72 6b 79 2e 69 6d 64 2e | 73 74 65 72 6c 69 6e 67 |rky.imd.|sterling|
|000000c0| 2e 63 6f 6d 3e 0a 58 2d | 4d 64 34 2d 53 69 67 6e |.com>.X-|Md4-Sign|
|000000d0| 61 74 75 72 65 3a 20 31 | 36 63 61 34 37 32 32 37 |ature: 1|6ca47227|
|000000e0| 30 37 65 39 62 39 35 34 | 34 63 36 61 65 38 64 39 |07e9b954|4c6ae8d9|
|000000f0| 63 36 31 32 32 64 63 0a | 44 61 74 65 3a 20 46 72 |c6122dc.|Date: Fr|
|00000100| 69 2c 20 34 20 53 65 70 | 20 31 39 39 32 20 31 35 |i, 4 Sep| 1992 15|
|00000110| 3a 32 31 3a 34 32 20 47 | 4d 54 0a 41 70 70 72 6f |:21:42 G|MT.Appro|
|00000120| 76 65 64 3a 20 6b 65 6e | 74 40 73 70 61 72 6b 79 |ved: ken|t@sparky|
|00000130| 2e 69 6d 64 2e 73 74 65 | 72 6c 69 6e 67 2e 63 6f |.imd.ste|rling.co|
|00000140| 6d 0a 0a 53 75 62 6d 69 | 74 74 65 64 2d 62 79 3a |m..Submi|tted-by:|
|00000150| 20 63 70 63 61 68 69 6c | 40 76 74 69 2e 63 6f 6d | cpcahil|@vti.com|
|00000160| 20 28 43 6f 6e 6f 72 20 | 50 2e 20 43 61 68 69 6c | (Conor |P. Cahil|
|00000170| 6c 29 0a 50 6f 73 74 69 | 6e 67 2d 6e 75 6d 62 65 |l).Posti|ng-numbe|
|00000180| 72 3a 20 56 6f 6c 75 6d | 65 20 33 32 2c 20 49 73 |r: Volum|e 32, Is|
|00000190| 73 75 65 20 31 30 0a 41 | 72 63 68 69 76 65 2d 6e |sue 10.A|rchive-n|
|000001a0| 61 6d 65 3a 20 64 62 6d | 61 6c 6c 6f 63 2f 70 61 |ame: dbm|alloc/pa|
|000001b0| 72 74 30 35 0a 45 6e 76 | 69 72 6f 6e 6d 65 6e 74 |rt05.Env|ironment|
|000001c0| 3a 20 43 2c 20 55 4e 49 | 58 0a 0a 23 21 20 2f 62 |: C, UNI|X..#! /b|
|000001d0| 69 6e 2f 73 68 0a 23 20 | 54 68 69 73 20 69 73 20 |in/sh.# |This is |
|000001e0| 61 20 73 68 65 6c 6c 20 | 61 72 63 68 69 76 65 2e |a shell |archive.|
|000001f0| 20 20 52 65 6d 6f 76 65 | 20 61 6e 79 74 68 69 6e | Remove| anythin|
|00000200| 67 20 62 65 66 6f 72 65 | 20 74 68 69 73 20 6c 69 |g before| this li|
|00000210| 6e 65 2c 20 74 68 65 6e | 20 75 6e 70 61 63 6b 0a |ne, then| unpack.|
|00000220| 23 20 69 74 20 62 79 20 | 73 61 76 69 6e 67 20 69 |# it by |saving i|
|00000230| 74 20 69 6e 74 6f 20 61 | 20 66 69 6c 65 20 61 6e |t into a| file an|
|00000240| 64 20 74 79 70 69 6e 67 | 20 22 73 68 20 66 69 6c |d typing| "sh fil|
|00000250| 65 22 2e 20 20 54 6f 20 | 6f 76 65 72 77 72 69 74 |e". To |overwrit|
|00000260| 65 20 65 78 69 73 74 69 | 6e 67 0a 23 20 66 69 6c |e existi|ng.# fil|
|00000270| 65 73 2c 20 74 79 70 65 | 20 22 73 68 20 66 69 6c |es, type| "sh fil|
|00000280| 65 20 2d 63 22 2e 20 20 | 59 6f 75 20 63 61 6e 20 |e -c". |You can |
|00000290| 61 6c 73 6f 20 66 65 65 | 64 20 74 68 69 73 20 61 |also fee|d this a|
|000002a0| 73 20 73 74 61 6e 64 61 | 72 64 20 69 6e 70 75 74 |s standa|rd input|
|000002b0| 20 76 69 61 0a 23 20 75 | 6e 73 68 61 72 2c 20 6f | via.# u|nshar, o|
|000002c0| 72 20 62 79 20 74 79 70 | 69 6e 67 20 22 73 68 20 |r by typ|ing "sh |
|000002d0| 3c 66 69 6c 65 22 2c 20 | 65 2e 67 2e 2e 20 20 49 |<file", |e.g.. I|
|000002e0| 66 20 74 68 69 73 20 61 | 72 63 68 69 76 65 20 69 |f this a|rchive i|
|000002f0| 73 20 63 6f 6d 70 6c 65 | 74 65 2c 20 79 6f 75 0a |s comple|te, you.|
|00000300| 23 20 77 69 6c 6c 20 73 | 65 65 20 74 68 65 20 66 |# will s|ee the f|
|00000310| 6f 6c 6c 6f 77 69 6e 67 | 20 6d 65 73 73 61 67 65 |ollowing| message|
|00000320| 20 61 74 20 74 68 65 20 | 65 6e 64 3a 0a 23 09 09 | at the |end:.#..|
|00000330| 22 45 6e 64 20 6f 66 20 | 61 72 63 68 69 76 65 20 |"End of |archive |
|00000340| 35 20 28 6f 66 20 31 30 | 29 2e 22 0a 23 20 43 6f |5 (of 10|).".# Co|
|00000350| 6e 74 65 6e 74 73 3a 20 | 20 6d 61 6c 6c 6f 63 2e |ntents: | malloc.|
|00000360| 33 20 6d 61 6c 6c 6f 63 | 69 6e 2e 68 0a 23 20 57 |3 malloc|in.h.# W|
|00000370| 72 61 70 70 65 64 20 62 | 79 20 63 70 63 61 68 69 |rapped b|y cpcahi|
|00000380| 6c 40 76 69 72 74 65 63 | 68 20 6f 6e 20 54 68 75 |l@virtec|h on Thu|
|00000390| 20 53 65 70 20 20 33 20 | 31 38 3a 33 39 3a 31 39 | Sep 3 |18:39:19|
|000003a0| 20 31 39 39 32 0a 50 41 | 54 48 3d 2f 62 69 6e 3a | 1992.PA|TH=/bin:|
|000003b0| 2f 75 73 72 2f 62 69 6e | 3a 2f 75 73 72 2f 75 63 |/usr/bin|:/usr/uc|
|000003c0| 62 20 3b 20 65 78 70 6f | 72 74 20 50 41 54 48 0a |b ; expo|rt PATH.|
|000003d0| 69 66 20 74 65 73 74 20 | 2d 66 20 27 6d 61 6c 6c |if test |-f 'mall|
|000003e0| 6f 63 2e 33 27 20 2d 61 | 20 22 24 7b 31 7d 22 20 |oc.3' -a| "${1}" |
|000003f0| 21 3d 20 22 2d 63 22 20 | 3b 20 74 68 65 6e 20 0a |!= "-c" |; then .|
|00000400| 20 20 65 63 68 6f 20 73 | 68 61 72 3a 20 57 69 6c | echo s|har: Wil|
|00000410| 6c 20 6e 6f 74 20 63 6c | 6f 62 62 65 72 20 65 78 |l not cl|obber ex|
|00000420| 69 73 74 69 6e 67 20 66 | 69 6c 65 20 5c 22 27 6d |isting f|ile \"'m|
|00000430| 61 6c 6c 6f 63 2e 33 27 | 5c 22 0a 65 6c 73 65 0a |alloc.3'|\".else.|
|00000440| 65 63 68 6f 20 73 68 61 | 72 3a 20 45 78 74 72 61 |echo sha|r: Extra|
|00000450| 63 74 69 6e 67 20 5c 22 | 27 6d 61 6c 6c 6f 63 2e |cting \"|'malloc.|
|00000460| 33 27 5c 22 20 5c 28 34 | 32 39 31 36 20 63 68 61 |3'\" \(4|2916 cha|
|00000470| 72 61 63 74 65 72 73 5c | 29 0a 73 65 64 20 22 73 |racters\|).sed "s|
|00000480| 2f 5e 58 2f 2f 22 20 3e | 27 6d 61 6c 6c 6f 63 2e |/^X//" >|'malloc.|
|00000490| 33 27 20 3c 3c 27 45 4e | 44 5f 4f 46 5f 46 49 4c |3' <<'EN|D_OF_FIL|
|000004a0| 45 27 0a 58 2e 54 48 20 | 44 45 42 55 47 5f 4d 41 |E'.X.TH |DEBUG_MA|
|000004b0| 4c 4c 4f 43 20 33 20 22 | 56 54 49 22 20 22 22 20 |LLOC 3 "|VTI" "" |
|000004c0| 22 31 2e 31 31 22 0a 58 | 2e 64 73 20 5d 54 20 0a |"1.11".X|.ds ]T .|
|000004d0| 58 27 5c 22 2f 2a 0a 58 | 27 5c 22 20 2a 20 28 63 |X'\"/*.X|'\" * (c|
|000004e0| 29 20 43 6f 70 79 72 69 | 67 68 74 20 31 39 39 30 |) Copyri|ght 1990|
|000004f0| 2c 20 31 39 39 31 2c 20 | 31 39 39 32 20 43 6f 6e |, 1991, |1992 Con|
|00000500| 6f 72 20 50 2e 20 43 61 | 68 69 6c 6c 20 28 63 70 |or P. Ca|hill (cp|
|00000510| 63 61 68 69 6c 40 76 69 | 72 74 65 63 68 2e 76 74 |cahil@vi|rtech.vt|
|00000520| 69 2e 63 6f 6d 29 2e 0a | 58 27 5c 22 20 2a 0a 58 |i.com)..|X'\" *.X|
|00000530| 27 5c 22 20 2a 20 54 68 | 69 73 20 73 6f 66 74 77 |'\" * Th|is softw|
|00000540| 61 72 65 20 6d 61 79 20 | 62 65 20 64 69 73 74 72 |are may |be distr|
|00000550| 69 62 75 74 65 64 20 66 | 72 65 65 6c 79 20 61 73 |ibuted f|reely as|
|00000560| 20 6c 6f 6e 67 20 61 73 | 20 74 68 65 20 66 6f 6c | long as| the fol|
|00000570| 6c 6f 77 69 6e 67 0a 58 | 27 5c 22 20 2a 20 63 6f |lowing.X|'\" * co|
|00000580| 6e 64 69 74 69 6f 6e 73 | 20 61 72 65 20 6d 65 74 |nditions| are met|
|00000590| 3a 0a 58 27 5c 22 20 2a | 0a 58 27 5c 22 20 2a 20 |:.X'\" *|.X'\" * |
|000005a0| 09 09 2a 20 74 68 65 20 | 64 69 73 74 72 69 62 75 |..* the |distribu|
|000005b0| 74 69 6f 6e 2c 20 6f 72 | 20 61 6e 79 20 64 65 72 |tion, or| any der|
|000005c0| 69 76 61 74 69 76 65 20 | 74 68 65 72 65 6f 66 2c |ivative |thereof,|
|000005d0| 20 6d 61 79 20 6e 6f 74 | 20 62 65 0a 58 27 5c 22 | may not| be.X'\"|
|000005e0| 20 2a 09 09 20 20 69 6e | 63 6c 75 64 65 64 20 61 | *.. in|cluded a|
|000005f0| 73 20 70 61 72 74 20 6f | 66 20 61 20 63 6f 6d 6d |s part o|f a comm|
|00000600| 65 72 63 69 61 6c 20 70 | 72 6f 64 75 63 74 0a 58 |ercial p|roduct.X|
|00000610| 27 5c 22 20 2a 09 09 2a | 20 66 75 6c 6c 20 73 6f |'\" *..*| full so|
|00000620| 75 72 63 65 20 63 6f 64 | 65 20 69 73 20 70 72 6f |urce cod|e is pro|
|00000630| 76 69 64 65 64 20 69 6e | 63 6c 75 64 69 6e 67 20 |vided in|cluding |
|00000640| 74 68 69 73 20 63 6f 70 | 79 72 69 67 68 74 0a 58 |this cop|yright.X|
|00000650| 27 5c 22 20 2a 09 09 2a | 20 74 68 65 72 65 20 69 |'\" *..*| there i|
|00000660| 73 20 6e 6f 20 63 68 61 | 72 67 65 20 66 6f 72 20 |s no cha|rge for |
|00000670| 74 68 65 20 73 6f 66 74 | 77 61 72 65 20 69 74 73 |the soft|ware its|
|00000680| 65 6c 66 20 28 74 68 65 | 72 65 20 6d 61 79 20 62 |elf (the|re may b|
|00000690| 65 0a 58 27 5c 22 20 2a | 09 09 20 20 61 20 6d 69 |e.X'\" *|.. a mi|
|000006a0| 6e 69 6d 61 6c 20 63 68 | 61 72 67 65 20 66 6f 72 |nimal ch|arge for|
|000006b0| 20 74 68 65 20 63 6f 70 | 79 69 6e 67 20 6f 72 20 | the cop|ying or |
|000006c0| 64 69 73 74 72 69 62 75 | 74 69 6f 6e 20 65 66 66 |distribu|tion eff|
|000006d0| 6f 72 74 29 0a 58 27 5c | 22 20 2a 09 09 2a 20 74 |ort).X'\|" *..* t|
|000006e0| 68 69 73 20 63 6f 70 79 | 72 69 67 68 74 20 6e 6f |his copy|right no|
|000006f0| 74 69 63 65 20 69 73 20 | 6e 6f 74 20 6d 6f 64 69 |tice is |not modi|
|00000700| 66 69 65 64 20 6f 72 20 | 72 65 6d 6f 76 65 64 20 |fied or |removed |
|00000710| 66 72 6f 6d 20 61 6e 79 | 0a 58 27 5c 22 20 2a 09 |from any|.X'\" *.|
|00000720| 09 20 20 73 6f 75 72 63 | 65 20 66 69 6c 65 0a 58 |. sourc|e file.X|
|00000730| 27 5c 22 20 2a 2f 0a 58 | 27 5c 22 20 0a 58 27 5c |'\" */.X|'\" .X'\|
|00000740| 22 20 24 49 64 3a 20 6d | 61 6c 6c 6f 63 2e 33 2c |" $Id: m|alloc.3,|
|00000750| 76 20 31 2e 32 38 20 31 | 39 39 32 2f 30 38 2f 32 |v 1.28 1|992/08/2|
|00000760| 32 20 31 36 3a 32 37 3a | 31 33 20 63 70 63 61 68 |2 16:27:|13 cpcah|
|00000770| 69 6c 20 45 78 70 20 24 | 0a 58 27 5c 22 20 0a 58 |il Exp $|.X'\" .X|
|00000780| 27 5c 22 20 65 58 20 6d | 61 63 72 6f 20 2d 20 20 |'\" eX m|acro - |
|00000790| 74 68 69 73 20 6d 61 63 | 72 6f 20 69 73 20 75 73 |this mac|ro is us|
|000007a0| 65 64 20 74 6f 20 73 65 | 74 20 75 70 20 63 6f 64 |ed to se|t up cod|
|000007b0| 65 2f 70 69 63 74 75 72 | 65 20 65 78 61 6d 70 6c |e/pictur|e exampl|
|000007c0| 65 73 2e 20 20 49 74 20 | 63 68 61 6e 67 65 73 0a |es. It |changes.|
|000007d0| 58 27 5c 22 20 20 20 20 | 20 20 20 20 20 20 20 20 |X'\" | |
|000007e0| 20 74 68 65 20 70 6f 69 | 6e 74 20 73 69 7a 65 20 | the poi|nt size |
|000007f0| 26 20 74 79 70 65 20 6f | 66 20 66 6f 6e 74 2c 20 |& type o|f font, |
|00000800| 69 6e 64 65 6e 74 73 20 | 74 68 65 20 65 78 61 6d |indents |the exam|
|00000810| 70 6c 65 20 31 2f 32 20 | 69 6e 63 68 2c 0a 58 27 |ple 1/2 |inch,.X'|
|00000820| 5c 22 09 09 61 6e 64 20 | 74 75 72 6e 73 20 6f 66 |\"..and |turns of|
|00000830| 66 20 66 69 6c 6c 20 6d | 6f 64 65 2e 20 20 54 6f |f fill m|ode. To|
|00000840| 20 75 73 65 20 69 74 20 | 6a 75 73 74 20 70 6c 61 | use it |just pla|
|00000850| 63 65 20 61 20 2e 65 58 | 20 62 65 66 6f 72 65 20 |ce a .eX| before |
|00000860| 61 6e 64 0a 58 27 5c 22 | 09 09 61 66 74 65 72 20 |and.X'\"|..after |
|00000870| 79 6f 75 72 20 65 78 61 | 6d 70 6c 65 0a 58 2e 64 |your exa|mple.X.d|
|00000880| 65 20 65 58 0a 58 2e 69 | 65 20 5c 5c 6e 28 65 58 |e eX.X.i|e \\n(eX|
|00000890| 3e 30 20 5c 7b 5c 0a 58 | 2e 6e 72 20 65 58 20 30 |>0 \{\.X|.nr eX 0|
|000008a0| 0a 58 2e 69 66 20 74 20 | 2e 66 74 0a 58 2e 66 69 |.X.if t |.ft.X.fi|
|000008b0| 0a 58 2e 76 73 0a 58 2e | 70 73 0a 58 2e 69 6e 0a |.X.vs.X.|ps.X.in.|
|000008c0| 58 2e 73 70 20 5c 7d 0a | 58 2e 65 6c 20 5c 7b 5c |X.sp \}.|X.el \{\|
|000008d0| 0a 58 2e 6e 72 20 65 58 | 20 31 0a 58 2e 62 72 0a |.X.nr eX| 1.X.br.|
|000008e0| 58 2e 6e 65 20 35 0a 58 | 2e 73 70 0a 58 2e 69 65 |X.ne 5.X|.sp.X.ie|
|000008f0| 20 5c 5c 6e 28 2e 24 3e | 30 20 2e 69 6e 20 2b 5c | \\n(.$>|0 .in +\|
|00000900| 5c 24 31 0a 58 2e 65 6c | 20 2e 69 6e 20 2b 2e 35 |\$1.X.el| .in +.5|
|00000910| 69 0a 58 2e 69 65 20 5c | 5c 6e 28 2e 24 3d 32 20 |i.X.ie \|\n(.$=2 |
|00000920| 2e 70 73 20 2d 5c 5c 24 | 32 0a 58 2e 65 6c 20 2e |.ps -\\$|2.X.el .|
|00000930| 70 73 20 2d 32 0a 58 2e | 69 65 20 5c 5c 6e 28 2e |ps -2.X.|ie \\n(.|
|00000940| 24 3d 32 20 2e 76 73 20 | 2d 5c 5c 24 32 0a 58 2e |$=2 .vs |-\\$2.X.|
|00000950| 65 6c 20 2e 76 73 20 2d | 32 0a 58 2e 69 66 20 74 |el .vs -|2.X.if t|
|00000960| 20 2e 66 74 20 43 57 0a | 58 2e 6e 66 20 5c 7d 0a | .ft CW.|X.nf \}.|
|00000970| 58 2e 2e 0a 58 2e 6e 72 | 20 65 58 20 30 0a 58 27 |X...X.nr| eX 0.X'|
|00000980| 5c 22 20 0a 58 27 5c 22 | 20 66 61 6b 65 20 73 65 |\" .X'\"| fake se|
|00000990| 74 20 6f 66 20 56 4c 20 | 4c 49 20 61 6e 64 20 4c |t of VL |LI and L|
|000009a0| 45 20 6d 61 63 72 6f 73 | 20 66 6f 72 20 6d 61 6e |E macros| for man|
|000009b0| 20 70 61 67 65 73 2e 20 | 20 54 68 69 73 20 73 65 | pages. | This se|
|000009c0| 74 20 64 6f 65 73 20 68 | 61 6e 64 6c 65 20 6e 65 |t does h|andle ne|
|000009d0| 73 74 65 64 0a 58 27 5c | 22 20 63 61 6c 6c 73 2c |sted.X'\|" calls,|
|000009e0| 20 62 75 74 20 64 6f 65 | 73 20 61 62 73 6f 6c 75 | but doe|s absolu|
|000009f0| 74 65 6c 79 20 4e 4f 20 | 65 72 72 6f 72 20 63 68 |tely NO |error ch|
|00000a00| 65 63 6b 69 6e 67 20 28 | 73 6f 20 79 6f 75 20 62 |ecking (|so you b|
|00000a10| 65 74 74 65 72 20 64 6f | 20 69 74 20 72 69 67 68 |etter do| it righ|
|00000a20| 74 29 2e 0a 58 27 5c 22 | 20 0a 58 2e 64 65 20 56 |t)..X'\"| .X.de V|
|00000a30| 4c 0a 58 2e 62 72 0a 58 | 2e 69 65 20 74 20 2e 6e |L.X.br.X|.ie t .n|
|00000a40| 72 20 56 4c 20 30 5c 5c | 24 31 0a 58 2e 65 6c 20 |r VL 0\\|$1.X.el |
|00000a50| 2e 6e 72 20 56 4c 20 30 | 5c 5c 24 31 2a 32 0a 58 |.nr VL 0|\\$1*2.X|
|00000a60| 2e 64 73 20 56 53 20 5c | 5c 24 31 20 5c 5c 2a 28 |.ds VS \|\$1 \\*(|
|00000a70| 56 53 0a 58 2e 69 6e 20 | 2b 5c 5c 6e 28 56 4c 0a |VS.X.in |+\\n(VL.|
|00000a80| 58 2e 69 66 20 74 20 2e | 69 6e 20 2b 2e 32 35 69 |X.if t .|in +.25i|
|00000a90| 0a 58 2e 2e 0a 58 2e 64 | 65 20 4c 49 0a 58 2e 62 |.X...X.d|e LI.X.b|
|00000aa0| 72 0a 58 2e 74 69 20 2d | 5c 5c 6e 28 56 4c 0a 58 |r.X.ti -|\\n(VL.X|
|00000ab0| 2e 6e 72 20 56 77 20 5c | 5c 6e 28 56 4c 6d 2d 5c |.nr Vw \|\n(VLm-\|
|00000ac0| 77 27 5c 5c 24 31 27 0a | 58 2e 69 66 20 5c 77 27 |w'\\$1'.|X.if \w'|
|00000ad0| 5c 5c 24 31 27 20 5c 26 | 5c 5c 24 31 5c 68 27 5c |\\$1' \&|\\$1\h'\|
|00000ae0| 5c 6e 28 56 77 75 27 5c | 26 5c 5c 63 0a 58 2e 2e |\n(Vwu'\|&\\c.X..|
|00000af0| 0a 58 2e 64 65 20 4c 45 | 0a 58 2e 62 72 0a 58 2e |.X.de LE|.X.br.X.|
|00000b00| 4c 65 20 5c 5c 2a 28 56 | 53 20 0a 58 2e 2e 0a 58 |Le \\*(V|S .X...X|
|00000b10| 2e 64 65 20 4c 65 0a 58 | 2e 69 6e 20 2d 5c 5c 6e |.de Le.X|.in -\\n|
|00000b20| 28 56 4c 0a 58 2e 69 66 | 20 74 20 2e 69 6e 20 2d |(VL.X.if| t .in -|
|00000b30| 2e 32 35 69 0a 58 2e 69 | 65 20 74 20 2e 6e 72 20 |.25i.X.i|e t .nr |
|00000b40| 56 4c 20 5c 5c 24 32 0a | 58 2e 65 6c 20 2e 6e 72 |VL \\$2.|X.el .nr|
|00000b50| 20 56 4c 20 5c 5c 24 32 | 2a 32 0a 58 2e 64 73 20 | VL \\$2|*2.X.ds |
|00000b60| 56 53 20 5c 5c 24 32 20 | 5c 5c 24 33 20 5c 5c 24 |VS \\$2 |\\$3 \\$|
|00000b70| 34 20 5c 5c 24 35 20 5c | 5c 24 36 20 5c 5c 24 37 |4 \\$5 \|\$6 \\$7|
|00000b80| 0a 58 2e 2e 0a 58 2e 64 | 73 20 56 53 0a 58 2e 6e |.X...X.d|s VS.X.n|
|00000b90| 72 20 56 4c 20 30 0a 58 | 2e 64 65 20 4d 50 0a 58 |r VL 0.X|.de MP.X|
|00000ba0| 2e 69 65 20 74 20 2e 73 | 70 20 5c 5c 6e 28 50 44 |.ie t .s|p \\n(PD|
|00000bb0| 75 0a 58 2e 65 6c 20 2e | 73 70 0a 58 2e 2e 0a 58 |u.X.el .|sp.X...X|
|00000bc0| 2e 64 65 20 50 0a 58 2e | 62 72 0a 58 2e 6e 65 20 |.de P.X.|br.X.ne |
|00000bd0| 34 0a 58 2e 73 70 0a 58 | 2e 2e 0a 58 2e 53 48 20 |4.X.sp.X|...X.SH |
|00000be0| 4e 41 4d 45 0a 58 64 62 | 6d 61 6c 6c 6f 63 20 5c |NAME.Xdb|malloc \|
|00000bf0| 2d 20 64 65 62 75 67 67 | 69 6e 67 20 6d 61 6c 6c |- debugg|ing mall|
|00000c00| 6f 63 20 6c 69 62 72 61 | 72 79 0a 58 2e 53 48 20 |oc libra|ry.X.SH |
|00000c10| 53 59 4e 4f 50 53 49 53 | 0a 58 2e 6e 66 0a 58 5c |SYNOPSIS|.X.nf.X\|
|00000c20| 66 42 23 69 6e 63 6c 75 | 64 65 20 3c 6d 61 6c 6c |fB#inclu|de <mall|
|00000c30| 6f 63 2e 68 3e 0a 58 2e | 4d 50 0a 58 69 6e 74 20 |oc.h>.X.|MP.Xint |
|00000c40| 6d 61 6c 6c 6f 63 5f 63 | 68 61 69 6e 5f 63 68 65 |malloc_c|hain_che|
|00000c50| 63 6b 28 66 6c 61 67 29 | 3b 0a 58 69 6e 74 20 66 |ck(flag)|;.Xint f|
|00000c60| 6c 61 67 3b 0a 58 2e 4d | 50 0a 58 76 6f 69 64 20 |lag;.X.M|P.Xvoid |
|00000c70| 6d 61 6c 6c 6f 63 5f 64 | 75 6d 70 28 66 64 29 3b |malloc_d|ump(fd);|
|00000c80| 0a 58 69 6e 74 20 66 64 | 3b 0a 58 2e 4d 50 0a 58 |.Xint fd|;.X.MP.X|
|00000c90| 76 6f 69 64 20 6d 61 6c | 6c 6f 63 5f 6c 69 73 74 |void mal|loc_list|
|00000ca0| 28 66 64 2c 68 69 73 74 | 69 64 31 2c 68 69 73 74 |(fd,hist|id1,hist|
|00000cb0| 69 64 32 29 3b 0a 58 69 | 6e 74 20 66 64 3b 0a 58 |id2);.Xi|nt fd;.X|
|00000cc0| 75 6e 73 69 67 6e 65 64 | 20 6c 6f 6e 67 20 68 69 |unsigned| long hi|
|00000cd0| 73 74 69 64 31 2c 20 68 | 69 73 74 69 64 32 3b 0a |stid1, h|istid2;.|
|00000ce0| 58 2e 4d 50 0a 58 75 6e | 73 69 67 6e 65 64 20 6c |X.MP.Xun|signed l|
|00000cf0| 6f 6e 67 20 6d 61 6c 6c | 6f 63 5f 69 6e 75 73 65 |ong mall|oc_inuse|
|00000d00| 28 68 69 73 74 69 64 70 | 74 72 29 3b 0a 58 75 6e |(histidp|tr);.Xun|
|00000d10| 73 69 67 6e 65 64 20 6c | 6f 6e 67 20 2a 20 68 69 |signed l|ong * hi|
|00000d20| 73 74 69 64 70 74 72 3b | 0a 58 2e 4d 50 0a 58 76 |stidptr;|.X.MP.Xv|
|00000d30| 6f 69 64 20 6d 61 6c 6c | 6f 63 5f 6d 61 72 6b 28 |oid mall|oc_mark(|
|00000d40| 70 74 72 29 3b 0a 58 63 | 68 61 72 09 2a 20 70 74 |ptr);.Xc|har.* pt|
|00000d50| 72 3b 0a 58 2e 4d 50 0a | 58 69 6e 74 20 64 62 6d |r;.X.MP.|Xint dbm|
|00000d60| 61 6c 6c 6f 70 74 28 63 | 6d 64 2c 76 61 6c 29 3b |allopt(c|md,val);|
|00000d70| 0a 58 69 6e 74 20 63 6d | 64 3b 20 0a 58 75 6e 69 |.Xint cm|d; .Xuni|
|00000d80| 6f 6e 20 64 62 6d 61 6c | 6c 6f 70 74 61 72 67 20 |on dbmal|loptarg |
|00000d90| 76 61 6c 3b 0a 58 2e 4d | 50 0a 58 76 6f 69 64 20 |val;.X.M|P.Xvoid |
|00000da0| 6d 61 6c 6c 6f 63 5f 61 | 62 6f 72 74 28 29 3b 0a |malloc_a|bort();.|
|00000db0| 58 2e 4d 50 0a 58 76 6f | 69 64 20 6d 61 6c 6c 6f |X.MP.Xvo|id mallo|
|00000dc0| 63 5f 65 6e 74 65 72 28 | 66 75 6e 63 29 3b 0a 58 |c_enter(|func);.X|
|00000dd0| 63 68 61 72 20 2a 20 66 | 75 6e 63 3b 0a 58 2e 4d |char * f|unc;.X.M|
|00000de0| 50 0a 58 76 6f 69 64 20 | 6d 61 6c 6c 6f 63 5f 6c |P.Xvoid |malloc_l|
|00000df0| 65 61 76 65 28 66 75 6e | 63 29 3b 0a 58 63 68 61 |eave(fun|c);.Xcha|
|00000e00| 72 20 2a 20 66 75 6e 63 | 3b 5c 66 50 0a 58 2e 66 |r * func|;\fP.X.f|
|00000e10| 69 0a 58 2e 53 48 20 44 | 45 53 43 52 49 50 54 49 |i.X.SH D|ESCRIPTI|
|00000e20| 4f 4e 0a 58 54 68 69 73 | 20 6d 61 6c 6c 6f 63 20 |ON.XThis| malloc |
|00000e30| 6c 69 62 72 61 72 79 20 | 69 73 20 61 20 72 65 70 |library |is a rep|
|00000e40| 6c 61 63 65 6d 65 6e 74 | 20 66 6f 72 20 74 68 65 |lacement| for the|
|00000e50| 20 73 74 61 6e 64 61 72 | 64 20 6c 69 62 72 61 72 | standar|d librar|
|00000e60| 79 20 74 6f 20 62 65 20 | 75 73 65 64 0a 58 64 75 |y to be |used.Xdu|
|00000e70| 72 69 6e 67 20 73 6f 66 | 74 77 61 72 65 20 64 65 |ring sof|tware de|
|00000e80| 76 65 6c 6f 70 6d 65 6e | 74 2f 64 65 62 75 67 67 |velopmen|t/debugg|
|00000e90| 69 6e 67 2e 20 20 53 65 | 65 20 74 68 65 20 73 74 |ing. Se|e the st|
|00000ea0| 61 6e 64 61 72 64 20 6d | 61 6c 6c 6f 63 28 33 29 |andard m|alloc(3)|
|00000eb0| 20 70 61 67 65 73 0a 58 | 66 6f 72 20 6d 6f 72 65 | pages.X|for more|
|00000ec0| 20 69 6e 66 6f 72 6d 61 | 74 69 6f 6e 20 6f 6e 20 | informa|tion on |
|00000ed0| 74 68 65 20 75 73 65 20 | 6f 66 20 74 68 65 20 66 |the use |of the f|
|00000ee0| 6f 6c 6c 6f 77 69 6e 67 | 20 66 75 6e 63 74 69 6f |ollowing| functio|
|00000ef0| 6e 73 3a 0a 58 2e 4d 50 | 0a 58 2e 6e 66 0a 58 2e |ns:.X.MP|.X.nf.X.|
|00000f00| 69 6e 20 2b 2e 35 69 0a | 58 5c 66 42 63 61 6c 6c |in +.5i.|X\fBcall|
|00000f10| 6f 63 5c 66 50 28 29 2c | 20 5c 66 42 63 66 72 65 |oc\fP(),| \fBcfre|
|00000f20| 65 5c 66 50 28 29 2c 20 | 5c 66 42 66 72 65 65 5c |e\fP(), |\fBfree\|
|00000f30| 66 50 28 29 2c 20 5c 66 | 42 6d 61 6c 6c 6f 63 5c |fP(), \f|Bmalloc\|
|00000f40| 66 50 28 29 2c 20 5c 66 | 42 72 65 61 6c 6c 6f 63 |fP(), \f|Brealloc|
|00000f50| 5c 66 50 28 29 0a 58 2e | 69 6e 20 2d 2e 35 69 0a |\fP().X.|in -.5i.|
|00000f60| 58 2e 66 69 0a 58 2e 4d | 50 0a 58 54 68 69 73 20 |X.fi.X.M|P.XThis |
|00000f70| 6c 69 62 72 61 72 79 20 | 64 69 66 66 65 72 73 20 |library |differs |
|00000f80| 66 72 6f 6d 20 74 68 65 | 20 73 74 61 6e 64 61 72 |from the| standar|
|00000f90| 64 20 6d 61 6c 6c 6f 63 | 20 6c 69 62 72 61 72 79 |d malloc| library|
|00000fa0| 20 69 6e 20 74 68 65 0a | 58 66 6f 6c 6c 6f 77 69 | in the.|Xfollowi|
|00000fb0| 6e 67 20 77 61 79 73 3a | 0a 58 2e 50 0a 58 31 2e |ng ways:|.X.P.X1.|
|00000fc0| 20 45 61 63 68 20 6d 61 | 6c 6c 6f 63 20 73 65 67 | Each ma|lloc seg|
|00000fd0| 6d 65 6e 74 20 63 6f 6e | 74 61 69 6e 73 20 61 20 |ment con|tains a |
|00000fe0| 6d 61 67 69 63 20 6e 75 | 6d 62 65 72 20 73 6f 20 |magic nu|mber so |
|00000ff0| 74 68 61 74 20 66 72 65 | 65 20 63 61 6e 20 0a 58 |that fre|e can .X|
|00001000| 76 65 72 69 66 79 20 74 | 68 61 74 20 74 68 65 20 |verify t|hat the |
|00001010| 70 6f 69 6e 74 65 72 20 | 70 61 73 73 65 64 20 70 |pointer |passed p|
|00001020| 6f 69 6e 74 73 20 74 6f | 20 61 20 76 61 6c 69 64 |oints to| a valid|
|00001030| 20 6d 61 6c 6c 6f 63 20 | 73 65 67 6d 65 6e 74 2e | malloc |segment.|
|00001040| 0a 58 2e 50 0a 58 32 2e | 20 45 61 63 68 20 6d 61 |.X.P.X2.| Each ma|
|00001050| 6c 6c 6f 63 20 73 65 67 | 6d 65 6e 74 20 69 73 20 |lloc seg|ment is |
|00001060| 66 69 6c 6c 65 64 20 77 | 69 74 68 20 61 20 6e 6f |filled w|ith a no|
|00001070| 6e 2d 7a 65 72 6f 20 70 | 61 74 74 65 72 6e 20 73 |n-zero p|attern s|
|00001080| 6f 20 74 68 61 74 20 63 | 6f 64 65 20 74 68 61 74 |o that c|ode that|
|00001090| 0a 58 64 65 70 65 6e 64 | 73 20 75 70 6f 6e 20 6d |.Xdepend|s upon m|
|000010a0| 61 6c 6c 6f 63 20 73 65 | 67 6d 65 6e 74 73 20 62 |alloc se|gments b|
|000010b0| 65 69 6e 67 20 6e 75 6c | 6c 20 77 69 6c 6c 20 66 |eing nul|l will f|
|000010c0| 61 69 6c 2e 0a 58 2e 50 | 0a 58 2e 6e 65 20 35 0a |ail..X.P|.X.ne 5.|
|000010d0| 58 33 2e 20 54 68 65 20 | 73 69 7a 65 20 6f 66 20 |X3. The |size of |
|000010e0| 65 61 63 68 20 73 65 67 | 6d 65 6e 74 20 77 69 6c |each seg|ment wil|
|000010f0| 6c 20 62 65 20 61 74 20 | 6c 65 61 73 74 20 31 20 |l be at |least 1 |
|00001100| 62 79 74 65 20 6c 61 72 | 67 65 72 20 74 68 61 6e |byte lar|ger than|
|00001110| 20 72 65 71 75 65 73 74 | 65 64 0a 58 61 6e 64 20 | request|ed.Xand |
|00001120| 74 68 65 20 65 78 74 72 | 61 20 62 79 74 65 73 20 |the extr|a bytes |
|00001130| 77 69 6c 6c 20 62 65 20 | 66 69 6c 6c 65 64 20 77 |will be |filled w|
|00001140| 69 74 68 20 61 20 6e 6f | 6e 2d 7a 65 72 6f 20 70 |ith a no|n-zero p|
|00001150| 61 74 74 65 72 6e 2e 20 | 20 57 68 65 6e 20 66 72 |attern. | When fr|
|00001160| 65 65 20 69 73 0a 58 63 | 61 6c 6c 65 64 2c 20 69 |ee is.Xc|alled, i|
|00001170| 74 20 77 69 6c 6c 20 76 | 65 72 69 66 79 20 74 68 |t will v|erify th|
|00001180| 61 74 20 79 6f 75 20 64 | 69 64 20 6e 6f 74 20 67 |at you d|id not g|
|00001190| 6f 20 62 65 79 6f 6e 64 | 20 74 68 65 20 6e 75 6d |o beyond| the num|
|000011a0| 62 65 72 20 6f 66 20 62 | 79 74 65 73 20 0a 58 79 |ber of b|ytes .Xy|
|000011b0| 6f 75 20 61 73 6b 65 64 | 20 66 6f 72 2e 0a 58 2e |ou asked| for..X.|
|000011c0| 50 0a 58 34 2e 20 57 68 | 65 6e 20 61 20 73 65 67 |P.X4. Wh|en a seg|
|000011d0| 6d 65 6e 74 20 69 73 20 | 66 72 65 65 64 2c 20 69 |ment is |freed, i|
|000011e0| 74 20 77 69 6c 6c 20 62 | 65 20 66 69 6c 6c 65 64 |t will b|e filled|
|000011f0| 20 77 69 74 68 20 61 20 | 64 69 66 66 65 72 65 6e | with a |differen|
|00001200| 74 20 6e 6f 6e 2d 7a 65 | 72 6f 20 70 61 74 74 65 |t non-ze|ro patte|
|00001210| 72 6e 0a 58 74 6f 20 65 | 6e 73 75 72 65 20 74 68 |rn.Xto e|nsure th|
|00001220| 61 74 20 74 68 65 20 70 | 72 6f 67 72 61 6d 20 64 |at the p|rogram d|
|00001230| 6f 65 73 6e 27 74 20 64 | 65 70 65 6e 64 20 75 70 |oesn't d|epend up|
|00001240| 6f 6e 20 74 68 65 20 75 | 73 65 20 6f 66 20 61 6c |on the u|se of al|
|00001250| 72 65 61 64 79 20 66 72 | 65 65 64 20 64 61 74 61 |ready fr|eed data|
|00001260| 2e 0a 58 2e 50 0a 58 2e | 6e 65 20 35 0a 58 35 2e |..X.P.X.|ne 5.X5.|
|00001270| 20 57 68 65 6e 65 76 65 | 72 20 61 6e 79 20 6f 66 | Wheneve|r any of|
|00001280| 20 74 68 65 20 73 74 72 | 69 6e 67 20 6f 72 20 6d | the str|ing or m|
|00001290| 65 6d 6f 72 79 20 66 75 | 6e 63 74 69 6f 6e 73 20 |emory fu|nctions |
|000012a0| 28 73 74 72 2a 2c 20 62 | 2a 2c 20 6d 65 6d 2a 29 |(str*, b|*, mem*)|
|000012b0| 20 61 72 65 20 0a 58 63 | 61 6c 6c 65 64 20 77 69 | are .Xc|alled wi|
|000012c0| 74 68 20 61 20 70 6f 69 | 6e 74 65 72 20 74 68 61 |th a poi|nter tha|
|000012d0| 74 20 69 73 20 77 69 74 | 68 69 6e 20 74 68 65 20 |t is wit|hin the |
|000012e0| 6d 61 6c 6c 6f 63 20 61 | 72 65 6e 61 2c 20 20 74 |malloc a|rena, t|
|000012f0| 68 65 20 6f 70 65 72 61 | 74 69 6f 6e 20 69 73 0a |he opera|tion is.|
|00001300| 58 63 68 65 63 6b 65 64 | 20 74 6f 20 76 65 72 69 |Xchecked| to veri|
|00001310| 66 79 20 74 68 61 74 20 | 69 74 20 64 6f 65 73 20 |fy that |it does |
|00001320| 6e 6f 74 20 6f 76 65 72 | 72 75 6e 20 74 68 65 20 |not over|run the |
|00001330| 6d 61 6c 6c 6f 63 65 64 | 20 73 65 67 6d 65 6e 74 |malloced| segment|
|00001340| 2e 20 20 41 20 66 61 69 | 6c 75 72 65 0a 58 6f 66 |. A fai|lure.Xof|
|00001350| 20 74 68 69 73 20 63 68 | 65 63 6b 20 69 73 20 63 | this ch|eck is c|
|00001360| 6f 6e 73 69 64 65 72 65 | 64 20 61 20 22 77 61 72 |onsidere|d a "war|
|00001370| 6e 69 6e 67 20 6c 65 76 | 65 6c 20 65 72 72 6f 72 |ning lev|el error|
|00001380| 22 20 28 64 65 73 63 72 | 69 62 65 64 20 6c 61 74 |" (descr|ibed lat|
|00001390| 65 72 29 20 61 6e 64 0a | 58 69 73 20 68 61 6e 64 |er) and.|Xis hand|
|000013a0| 6c 65 64 20 61 63 63 6f | 72 64 69 6e 67 6c 79 2e |led acco|rdingly.|
|000013b0| 0a 58 2e 50 0a 58 36 2e | 20 52 75 6e 20 74 69 6d |.X.P.X6.| Run tim|
|000013c0| 65 20 63 68 65 63 6b 69 | 6e 67 20 63 61 6e 20 69 |e checki|ng can i|
|000013d0| 6e 63 6c 75 64 65 20 76 | 65 72 69 66 69 63 61 74 |nclude v|erificat|
|000013e0| 69 6f 6e 20 6f 66 20 74 | 68 65 20 6d 61 6c 6c 6f |ion of t|he mallo|
|000013f0| 63 20 63 68 61 69 6e 20 | 61 74 20 65 61 63 68 0a |c chain |at each.|
|00001400| 58 61 6e 64 20 65 76 65 | 72 79 20 63 61 6c 6c 20 |Xand eve|ry call |
|00001410| 74 6f 20 6f 6e 65 20 6f | 66 20 74 68 65 20 6d 61 |to one o|f the ma|
|00001420| 6c 6c 6f 63 20 66 75 6e | 63 74 69 6f 6e 73 20 6f |lloc fun|ctions o|
|00001430| 72 20 6d 61 6e 75 61 6c | 6c 79 20 62 79 20 63 61 |r manual|ly by ca|
|00001440| 6c 6c 69 6e 67 20 74 68 | 65 0a 58 6d 61 6c 6c 6f |lling th|e.Xmallo|
|00001450| 63 5f 63 68 61 69 6e 5f | 63 68 65 63 6b 20 66 75 |c_chain_|check fu|
|00001460| 6e 63 74 69 6f 6e 2e 0a | 58 2e 50 0a 58 37 2e 20 |nction..|X.P.X7. |
|00001470| 45 78 74 65 6e 73 69 76 | 65 20 73 75 70 70 6f 72 |Extensiv|e suppor|
|00001480| 74 20 66 6f 72 20 74 72 | 61 63 6b 69 6e 67 20 6d |t for tr|acking m|
|00001490| 65 6d 6f 72 79 20 6c 65 | 61 6b 73 20 69 73 20 70 |emory le|aks is p|
|000014a0| 72 6f 76 69 64 65 64 2e | 0a 58 2e 50 0a 58 2e 62 |rovided.|.X.P.X.b|
|000014b0| 72 0a 58 2e 6e 65 20 31 | 35 0a 58 57 68 65 6e 20 |r.X.ne 1|5.XWhen |
|000014c0| 61 20 70 72 6f 62 6c 65 | 6d 20 69 73 20 66 6f 75 |a proble|m is fou|
|000014d0| 6e 64 2c 20 74 68 65 20 | 66 6f 6c 6c 6f 77 69 6e |nd, the |followin|
|000014e0| 67 20 65 72 72 6f 72 20 | 6d 65 73 73 61 67 65 20 |g error |message |
|000014f0| 69 73 20 64 69 73 70 6c | 61 79 65 64 3a 0a 58 2e |is displ|ayed:.X.|
|00001500| 65 58 0a 58 4d 41 4c 4c | 4f 43 20 57 61 72 6e 69 |eX.XMALL|OC Warni|
|00001510| 6e 67 20 66 72 6f 6d 20 | 66 75 6e 63 6e 61 6d 65 |ng from |funcname|
|00001520| 28 29 20 28 63 61 6c 6c | 65 64 20 66 72 6f 6d 20 |() (call|ed from |
|00001530| 66 69 6c 65 6e 61 6d 65 | 2e 63 20 6c 69 6e 65 20 |filename|.c line |
|00001540| 23 23 23 29 3a 0a 58 57 | 61 72 6e 69 6e 67 20 6d |###):.XW|arning m|
|00001550| 65 73 73 61 67 65 20 67 | 6f 65 73 20 68 65 72 65 |essage g|oes here|
|00001560| 0a 58 2e 65 58 0a 58 5c | 66 42 66 75 6e 63 6e 61 |.X.eX.X\|fBfuncna|
|00001570| 6d 65 5c 66 50 20 69 73 | 20 74 68 65 20 6e 61 6d |me\fP is| the nam|
|00001580| 65 20 6f 66 20 74 68 65 | 20 66 75 6e 63 74 69 6f |e of the| functio|
|00001590| 6e 20 74 68 61 74 20 68 | 61 73 20 66 6f 75 6e 64 |n that h|as found|
|000015a0| 20 74 68 65 20 70 72 6f | 62 6c 65 6d 0a 58 61 6e | the pro|blem.Xan|
|000015b0| 64 20 77 69 6c 6c 20 75 | 73 75 61 6c 6c 79 20 62 |d will u|sually b|
|000015c0| 65 20 61 6e 20 65 6e 74 | 72 79 20 70 6f 69 6e 74 |e an ent|ry point|
|000015d0| 20 69 6e 74 6f 20 74 68 | 65 20 6c 69 62 72 61 72 | into th|e librar|
|000015e0| 79 2e 20 20 54 68 65 20 | 69 6e 66 6f 72 6d 61 74 |y. The |informat|
|000015f0| 69 6f 6e 0a 58 74 68 61 | 74 20 69 64 65 6e 74 69 |ion.Xtha|t identi|
|00001600| 66 69 65 73 20 77 68 65 | 72 65 20 74 68 65 20 66 |fies whe|re the f|
|00001610| 75 6e 63 74 69 6f 6e 20 | 69 73 20 63 61 6c 6c 65 |unction |is calle|
|00001620| 64 20 66 72 6f 6d 20 77 | 69 6c 6c 20 6f 6e 6c 79 |d from w|ill only|
|00001630| 20 62 65 20 0a 58 61 76 | 61 69 6c 61 62 6c 65 20 | be .Xav|ailable |
|00001640| 69 66 20 74 68 65 20 73 | 6f 75 72 63 65 20 6d 6f |if the s|ource mo|
|00001650| 64 75 6c 65 20 77 61 73 | 20 63 6f 6d 70 69 6c 65 |dule was| compile|
|00001660| 64 20 77 69 74 68 20 74 | 68 65 20 5c 66 42 6d 61 |d with t|he \fBma|
|00001670| 6c 6c 6f 63 2e 68 5c 66 | 50 0a 58 66 69 6c 65 20 |lloc.h\f|P.Xfile |
|00001680| 69 6e 63 6c 75 64 65 64 | 2e 0a 58 2e 50 0a 58 49 |included|..X.P.XI|
|00001690| 66 20 74 68 65 20 65 72 | 72 6f 72 20 69 73 20 63 |f the er|ror is c|
|000016a0| 61 75 73 65 64 20 62 79 | 20 61 20 70 72 6f 62 6c |aused by| a probl|
|000016b0| 65 6d 20 69 6e 20 74 68 | 65 20 6d 61 6c 6c 6f 63 |em in th|e malloc|
|000016c0| 20 63 68 61 69 6e 20 61 | 6e 64 20 74 68 65 20 6f | chain a|nd the o|
|000016d0| 66 66 65 6e 64 69 6e 67 | 0a 58 63 68 61 69 6e 20 |ffending|.Xchain |
|000016e0| 65 6c 65 6d 65 6e 74 20 | 63 61 6e 20 62 65 20 69 |element |can be i|
|000016f0| 64 65 6e 74 69 66 69 65 | 64 2c 20 74 68 65 20 66 |dentifie|d, the f|
|00001700| 6f 6c 6c 6f 77 69 6e 67 | 20 69 6e 66 6f 72 6d 61 |ollowing| informa|
|00001710| 74 69 6f 6e 20 69 73 20 | 61 6c 73 6f 0a 58 64 69 |tion is |also.Xdi|
|00001720| 73 70 6c 61 79 65 64 20 | 28 4e 4f 54 45 3a 20 74 |splayed |(NOTE: t|
|00001730| 68 69 73 20 69 73 20 6a | 75 73 74 20 61 20 67 75 |his is j|ust a gu|
|00001740| 65 73 73 20 62 79 20 74 | 68 65 20 73 6f 66 74 77 |ess by t|he softw|
|00001750| 61 72 65 2c 20 69 74 20 | 6d 61 79 20 6e 6f 74 0a |are, it |may not.|
|00001760| 58 62 65 20 74 68 65 20 | 61 63 74 75 61 6c 20 63 |Xbe the |actual c|
|00001770| 75 6c 70 72 69 74 29 3a | 0a 58 2e 65 58 0a 58 54 |ulprit):|.X.eX.XT|
|00001780| 68 69 73 20 65 72 72 6f | 72 20 69 73 20 2a 70 72 |his erro|r is *pr|
|00001790| 6f 62 61 62 6c 79 2a 20 | 61 73 73 6f 63 69 61 74 |obably* |associat|
|000017a0| 65 64 20 77 69 74 68 20 | 74 68 65 20 66 6f 6c 6c |ed with |the foll|
|000017b0| 6f 77 69 6e 67 20 61 6c | 6c 6f 63 61 74 69 6f 6e |owing al|location|
|000017c0| 3a 0a 58 0a 58 20 20 20 | 41 20 63 61 6c 6c 20 74 |:.X.X |A call t|
|000017d0| 6f 20 6d 61 6c 6c 6f 63 | 20 66 6f 72 20 33 33 20 |o malloc| for 33 |
|000017e0| 62 79 74 65 73 20 69 6e | 20 70 72 6f 67 72 61 6d |bytes in| program|
|000017f0| 2e 63 20 6f 6e 20 6c 69 | 6e 65 20 38 33 34 2e 0a |.c on li|ne 834..|
|00001800| 58 20 20 20 54 68 69 73 | 20 77 61 73 20 74 68 65 |X This| was the|
|00001810| 20 31 37 32 6e 64 20 63 | 61 6c 6c 20 74 6f 20 6d | 172nd c|all to m|
|00001820| 61 6c 6c 6f 63 2e 0a 58 | 2e 65 58 0a 58 2e 62 72 |alloc..X|.eX.X.br|
|00001830| 0a 58 2e 6e 65 20 31 35 | 0a 58 54 68 69 73 20 65 |.X.ne 15|.XThis e|
|00001840| 78 61 6d 70 6c 65 20 61 | 73 73 75 6d 65 73 20 74 |xample a|ssumes t|
|00001850| 68 61 74 20 5c 66 42 70 | 72 6f 67 72 61 6d 2e 63 |hat \fBp|rogram.c|
|00001860| 5c 66 50 20 69 6e 63 6c | 75 64 65 64 20 74 68 65 |\fP incl|uded the|
|00001870| 20 64 65 62 75 67 67 69 | 6e 67 20 0a 58 6c 69 62 | debuggi|ng .Xlib|
|00001880| 72 61 72 79 20 5c 66 42 | 6d 61 6c 6c 6f 63 2e 68 |rary \fB|malloc.h|
|00001890| 5c 66 50 20 66 69 6c 65 | 2e 20 20 49 66 20 6e 6f |\fP file|. If no|
|000018a0| 74 2c 20 74 68 65 20 69 | 64 65 6e 74 69 66 69 63 |t, the i|dentific|
|000018b0| 61 74 69 6f 6e 20 69 6e | 66 6f 72 6d 61 74 69 6f |ation in|formatio|
|000018c0| 6e 0a 58 77 69 6c 6c 20 | 62 65 20 61 73 20 66 6f |n.Xwill |be as fo|
|000018d0| 6c 6c 6f 77 73 3a 0a 58 | 2e 65 58 0a 58 54 68 69 |llows:.X|.eX.XThi|
|000018e0| 73 20 65 72 72 6f 72 20 | 69 73 20 2a 70 72 6f 62 |s error |is *prob|
|000018f0| 61 62 6c 79 2a 20 61 73 | 73 6f 63 69 61 74 65 64 |ably* as|sociated|
|00001900| 20 77 69 74 68 20 74 68 | 65 20 66 6f 6c 6c 6f 77 | with th|e follow|
|00001910| 69 6e 67 20 61 6c 6c 6f | 63 61 74 69 6f 6e 3a 0a |ing allo|cation:.|
|00001920| 58 0a 58 20 20 20 41 20 | 63 61 6c 6c 20 74 6f 20 |X.X A |call to |
|00001930| 6d 61 6c 6c 6f 63 20 66 | 6f 72 20 33 33 20 62 79 |malloc f|or 33 by|
|00001940| 74 65 73 20 69 6e 20 61 | 6e 20 75 6e 6b 6e 6f 77 |tes in a|n unknow|
|00001950| 6e 20 66 69 6c 65 2e 0a | 58 20 20 20 54 68 69 73 |n file..|X This|
|00001960| 20 77 61 73 20 74 68 65 | 20 31 37 32 6e 64 20 63 | was the| 172nd c|
|00001970| 61 6c 6c 20 74 6f 20 6d | 61 6c 6c 6f 63 2e 0a 58 |all to m|alloc..X|
|00001980| 2e 65 58 0a 58 54 68 65 | 20 69 64 65 6e 74 69 66 |.eX.XThe| identif|
|00001990| 69 63 61 74 69 6f 6e 20 | 6f 66 20 77 68 69 63 68 |ication |of which|
|000019a0| 20 63 61 6c 6c 20 74 6f | 20 6d 61 6c 6c 6f 63 20 | call to| malloc |
|000019b0| 69 73 20 61 73 73 6f 63 | 69 61 74 65 64 20 77 69 |is assoc|iated wi|
|000019c0| 74 68 20 74 68 65 20 0a | 58 70 72 6f 62 6c 65 6d |th the .|Xproblem|
|000019d0| 20 69 73 20 68 65 6c 70 | 66 75 6c 20 69 6e 20 74 | is help|ful in t|
|000019e0| 68 61 74 20 69 74 20 67 | 69 76 65 73 20 79 6f 75 |hat it g|ives you|
|000019f0| 20 74 68 65 20 69 6e 66 | 6f 72 6d 61 74 69 6f 6e | the inf|ormation|
|00001a00| 20 6e 65 63 65 73 73 61 | 72 79 0a 58 74 6f 20 73 | necessa|ry.Xto s|
|00001a10| 65 74 20 74 68 65 20 62 | 72 65 61 6b 70 6f 69 6e |et the b|reakpoin|
|00001a20| 74 20 6f 6e 20 74 68 65 | 20 61 6c 6c 6f 63 61 74 |t on the| allocat|
|00001a30| 69 6f 6e 20 66 75 6e 63 | 74 69 6f 6e 20 66 6f 72 |ion func|tion for|
|00001a40| 20 74 68 61 74 20 70 61 | 72 74 69 63 75 6c 61 72 | that pa|rticular|
|00001a50| 0a 58 69 6e 76 6f 63 61 | 74 69 6f 6e 20 28 62 72 |.Xinvoca|tion (br|
|00001a60| 65 61 6b 70 6f 69 6e 74 | 73 20 75 73 75 61 6c 6c |eakpoint|s usuall|
|00001a70| 79 20 63 61 6e 20 68 61 | 76 65 20 63 6f 75 6e 74 |y can ha|ve count|
|00001a80| 65 72 73 20 61 73 73 6f | 63 69 61 74 65 64 20 77 |ers asso|ciated w|
|00001a90| 69 74 68 0a 58 74 68 65 | 6d 29 2e 20 20 54 68 65 |ith.Xthe|m). The|
|00001aa0| 20 63 6f 75 6e 74 65 72 | 73 20 66 6f 72 20 74 68 | counter|s for th|
|00001ab0| 65 20 74 68 72 65 65 20 | 70 72 69 6d 61 72 79 20 |e three |primary |
|00001ac0| 61 6c 6c 6f 63 61 74 69 | 6f 6e 20 65 6e 74 72 79 |allocati|on entry|
|00001ad0| 20 70 6f 69 6e 74 73 20 | 28 6d 61 6c 6c 6f 63 2c | points |(malloc,|
|00001ae0| 0a 58 63 61 6c 6c 6f 63 | 2c 20 61 6e 64 20 72 65 |.Xcalloc|, and re|
|00001af0| 61 6c 6c 6f 63 29 20 61 | 72 65 20 6d 61 6e 61 67 |alloc) a|re manag|
|00001b00| 65 64 20 73 65 70 61 72 | 61 74 65 6c 79 2e 0a 58 |ed separ|ately..X|
|00001b10| 2e 50 0a 58 2e 62 72 0a | 58 2e 6e 65 20 35 0a 58 |.P.X.br.|X.ne 5.X|
|00001b20| 4e 4f 54 45 20 31 3a 20 | 69 66 20 79 6f 75 20 77 |NOTE 1: |if you w|
|00001b30| 61 6e 74 20 74 6f 20 73 | 65 74 20 61 20 62 72 65 |ant to s|et a bre|
|00001b40| 61 6b 70 6f 69 6e 74 20 | 74 6f 20 63 61 70 74 75 |akpoint |to captu|
|00001b50| 72 65 20 74 68 69 73 20 | 69 6e 76 6f 63 61 74 69 |re this |invocati|
|00001b60| 6f 6e 0a 58 6f 66 20 6d | 61 6c 6c 6f 63 2c 20 74 |on.Xof m|alloc, t|
|00001b70| 68 65 20 61 63 74 75 61 | 6c 20 66 75 6e 63 74 69 |he actua|l functi|
|00001b80| 6f 6e 20 74 68 61 74 20 | 69 73 20 62 65 69 6e 67 |on that |is being|
|00001b90| 20 63 61 6c 6c 65 64 20 | 69 73 20 5c 66 42 64 65 | called |is \fBde|
|00001ba0| 62 75 67 5f 6d 61 6c 6c | 6f 63 5c 66 50 0a 58 28 |bug_mall|oc\fP.X(|
|00001bb0| 6f 72 20 5c 66 42 64 65 | 62 75 67 5f 72 65 61 6c |or \fBde|bug_real|
|00001bc0| 6c 6f 63 5c 66 50 20 66 | 6f 72 20 5c 66 42 72 65 |loc\fP f|or \fBre|
|00001bd0| 61 6c 6c 6f 63 5c 66 50 | 20 61 6e 64 20 5c 66 42 |alloc\fP| and \fB|
|00001be0| 64 65 62 75 67 5f 63 61 | 6c 6c 6f 63 5c 66 50 20 |debug_ca|lloc\fP |
|00001bf0| 66 6f 72 0a 58 5c 66 42 | 63 61 6c 6c 6f 63 5c 66 |for.X\fB|calloc\f|
|00001c00| 50 29 20 61 6e 64 20 74 | 68 61 74 20 69 73 20 77 |P) and t|hat is w|
|00001c10| 68 65 72 65 20 74 68 65 | 20 62 72 65 61 6b 70 6f |here the| breakpo|
|00001c20| 69 6e 74 20 73 68 6f 75 | 6c 64 20 62 65 20 73 65 |int shou|ld be se|
|00001c30| 74 2e 0a 58 2e 50 0a 58 | 2e 62 72 0a 58 2e 6e 65 |t..X.P.X|.br.X.ne|
|00001c40| 20 31 39 0a 58 4e 4f 54 | 45 20 32 3a 20 53 69 6e | 19.XNOT|E 2: Sin|
|00001c50| 63 65 20 74 68 65 20 73 | 6f 66 74 77 61 72 65 20 |ce the s|oftware |
|00001c60| 69 73 20 67 75 65 73 73 | 69 6e 67 20 61 74 20 74 |is guess|ing at t|
|00001c70| 68 65 20 6f 66 66 65 6e | 64 69 6e 67 20 6d 61 6c |he offen|ding mal|
|00001c80| 6c 6f 63 0a 58 63 68 61 | 69 6e 20 73 65 67 6d 65 |loc.Xcha|in segme|
|00001c90| 6e 74 2c 20 69 74 20 69 | 73 20 70 6f 73 73 69 62 |nt, it i|s possib|
|00001ca0| 6c 65 20 74 68 61 74 20 | 6f 6e 65 20 6f 66 20 74 |le that |one of t|
|00001cb0| 68 65 20 6e 65 61 72 62 | 79 20 73 65 67 6d 65 6e |he nearb|y segmen|
|00001cc0| 74 73 20 0a 58 69 73 20 | 61 63 74 75 61 6c 6c 79 |ts .Xis |actually|
|00001cd0| 20 74 68 65 20 63 75 6c | 70 72 69 74 2e 20 20 49 | the cul|prit. I|
|00001ce0| 66 20 74 68 65 20 65 6e | 76 69 72 6f 6e 6d 65 6e |f the en|vironmen|
|00001cf0| 74 20 76 61 72 69 61 62 | 6c 65 20 5c 73 2d 32 4d |t variab|le \s-2M|
|00001d00| 41 4c 4c 4f 43 5f 53 48 | 4f 57 5f 4c 49 4e 4b 53 |ALLOC_SH|OW_LINKS|
|00001d10| 5c 73 2b 32 0a 58 69 73 | 20 73 65 74 2c 20 62 6f |\s+2.Xis| set, bo|
|00001d20| 74 68 20 74 68 65 20 73 | 65 67 6d 65 6e 74 20 70 |th the s|egment p|
|00001d30| 72 65 63 65 64 69 6e 67 | 20 61 6e 64 20 74 68 65 |receding| and the|
|00001d40| 20 73 65 67 6d 65 6e 74 | 20 66 6f 6c 6c 6f 77 69 | segment| followi|
|00001d50| 6e 67 20 74 68 65 20 61 | 63 63 75 73 65 64 0a 58 |ng the a|ccused.X|
|00001d60| 73 65 67 6d 65 6e 74 20 | 77 69 6c 6c 20 61 6c 73 |segment |will als|
|00001d70| 6f 20 62 65 20 69 64 65 | 6e 74 69 66 69 65 64 2e |o be ide|ntified.|
|00001d80| 20 20 54 68 65 20 66 6f | 6c 6c 6f 77 69 6e 67 20 | The fo|llowing |
|00001d90| 69 73 20 61 20 73 61 6d | 70 6c 65 20 6f 75 74 70 |is a sam|ple outp|
|00001da0| 75 74 3a 0a 58 2e 65 58 | 0a 58 54 68 69 73 20 65 |ut:.X.eX|.XThis e|
|00001db0| 72 72 6f 72 20 69 73 20 | 2a 70 72 6f 62 61 62 6c |rror is |*probabl|
|00001dc0| 79 2a 20 61 73 73 6f 63 | 69 61 74 65 64 20 77 69 |y* assoc|iated wi|
|00001dd0| 74 68 20 74 68 65 20 66 | 6f 6c 6c 6f 77 69 6e 67 |th the f|ollowing|
|00001de0| 20 61 6c 6c 6f 63 61 74 | 69 6f 6e 3a 0a 58 0a 58 | allocat|ion:.X.X|
|00001df0| 20 20 20 20 41 20 63 61 | 6c 6c 20 74 6f 20 6d 61 | A ca|ll to ma|
|00001e00| 6c 6c 6f 63 20 66 6f 72 | 20 33 33 20 62 79 74 65 |lloc for| 33 byte|
|00001e10| 73 20 69 6e 20 61 6e 20 | 75 6e 6b 6e 6f 77 6e 20 |s in an |unknown |
|00001e20| 66 69 6c 65 2e 0a 58 20 | 20 20 20 54 68 69 73 20 |file..X | This |
|00001e30| 77 61 73 20 74 68 65 20 | 31 37 32 6e 64 20 63 61 |was the |172nd ca|
|00001e40| 6c 6c 20 74 6f 20 6d 61 | 6c 6c 6f 63 2e 0a 58 0a |ll to ma|lloc..X.|
|00001e50| 58 20 20 20 20 54 68 65 | 20 6d 61 6c 6c 6f 63 20 |X The| malloc |
|00001e60| 63 68 61 69 6e 20 65 6c | 65 6d 65 6e 74 20 70 72 |chain el|ement pr|
|00001e70| 69 6f 72 20 74 6f 20 74 | 68 65 20 73 75 73 70 65 |ior to t|he suspe|
|00001e80| 63 74 20 61 6c 6c 6f 63 | 61 74 69 6f 6e 20 69 73 |ct alloc|ation is|
|00001e90| 20 66 72 6f 6d 3a 0a 58 | 0a 58 20 20 20 20 41 20 | from:.X|.X A |
|00001ea0| 63 61 6c 6c 20 74 6f 20 | 63 61 6c 6c 6f 63 20 66 |call to |calloc f|
|00001eb0| 6f 72 20 35 31 32 20 62 | 79 74 65 73 20 69 6e 20 |or 512 b|ytes in |
|00001ec0| 6d 61 69 6e 2e 63 20 6c | 69 6e 65 20 31 36 2e 0a |main.c l|ine 16..|
|00001ed0| 58 20 20 20 20 54 68 69 | 73 20 77 61 73 20 74 68 |X Thi|s was th|
|00001ee0| 65 20 34 74 68 20 63 61 | 6c 6c 20 74 6f 20 63 61 |e 4th ca|ll to ca|
|00001ef0| 6c 6c 6f 63 2e 20 0a 58 | 20 20 20 20 54 68 69 73 |lloc. .X| This|
|00001f00| 20 62 6c 6f 63 6b 20 77 | 61 73 20 66 72 65 65 64 | block w|as freed|
|00001f10| 20 6f 6e 20 74 68 65 20 | 32 6e 64 20 63 61 6c 6c | on the |2nd call|
|00001f20| 20 74 6f 20 66 72 65 65 | 28 29 0a 58 20 20 20 20 | to free|().X |
|00001f30| 69 6e 20 6d 61 69 6e 2e | 63 20 6f 6e 20 6c 69 6e |in main.|c on lin|
|00001f40| 65 20 35 31 2e 0a 58 20 | 0a 58 20 20 20 20 54 68 |e 51..X |.X Th|
|00001f50| 65 20 6d 61 6c 6c 6f 63 | 20 63 68 61 69 6e 20 65 |e malloc| chain e|
|00001f60| 6c 65 6d 65 6e 74 20 66 | 6f 6c 6c 6f 77 69 6e 67 |lement f|ollowing|
|00001f70| 20 74 68 65 20 73 75 73 | 70 65 63 74 20 61 6c 6c | the sus|pect all|
|00001f80| 6f 63 61 74 69 6f 6e 20 | 69 73 20 66 72 6f 6d 3a |ocation |is from:|
|00001f90| 20 0a 58 0a 58 20 20 20 | 20 41 20 63 61 6c 6c 20 | .X.X | A call |
|00001fa0| 74 6f 20 72 65 61 6c 6c | 6f 63 20 66 6f 72 20 34 |to reall|oc for 4|
|00001fb0| 30 39 36 20 62 79 74 65 | 73 20 69 6e 20 66 75 6e |096 byte|s in fun|
|00001fc0| 63 2e 63 20 6c 69 6e 65 | 20 33 37 36 2e 0a 58 20 |c.c line| 376..X |
|00001fd0| 20 20 20 54 68 69 73 20 | 77 61 73 20 74 68 65 20 | This |was the |
|00001fe0| 31 73 74 20 63 61 6c 6c | 20 74 6f 20 72 65 61 6c |1st call| to real|
|00001ff0| 6c 6f 63 2e 0a 58 2e 65 | 58 0a 58 2e 62 72 0a 58 |loc..X.e|X.X.br.X|
|00002000| 2e 6e 65 20 31 35 0a 58 | 4f 6e 63 65 20 74 68 65 |.ne 15.X|Once the|
|00002010| 20 65 72 72 6f 72 20 6d | 65 73 73 61 67 65 20 68 | error m|essage h|
|00002020| 61 73 20 62 65 65 6e 20 | 64 69 73 70 6c 61 79 65 |as been |displaye|
|00002030| 64 2c 20 74 68 65 20 73 | 6f 66 74 77 61 72 65 20 |d, the s|oftware |
|00002040| 77 69 6c 6c 20 74 68 65 | 6e 20 0a 58 64 65 74 65 |will the|n .Xdete|
|00002050| 72 6d 69 6e 65 20 68 6f | 77 20 74 6f 20 68 61 6e |rmine ho|w to han|
|00002060| 64 6c 65 20 74 68 65 20 | 65 72 72 6f 72 2e 20 20 |dle the |error. |
|00002070| 54 68 69 73 20 68 61 6e | 64 6c 69 6e 67 20 77 69 |This han|dling wi|
|00002080| 6c 6c 20 62 65 20 62 61 | 73 65 64 20 75 70 6f 6e |ll be ba|sed upon|
|00002090| 0a 58 74 68 65 20 74 79 | 70 65 20 6f 66 20 65 72 |.Xthe ty|pe of er|
|000020a0| 72 6f 72 20 6c 65 76 65 | 6c 20 28 77 61 72 6e 69 |ror leve|l (warni|
|000020b0| 6e 67 20 6f 72 20 66 61 | 74 61 6c 29 20 61 6e 64 |ng or fa|tal) and|
|000020c0| 20 74 68 65 20 65 72 72 | 6f 72 20 68 61 6e 64 6c | the err|or handl|
|000020d0| 69 6e 67 20 69 6e 20 65 | 66 66 65 63 74 0a 58 66 |ing in e|ffect.Xf|
|000020e0| 6f 72 20 74 68 61 74 20 | 65 72 72 6f 72 20 6c 65 |or that |error le|
|000020f0| 76 65 6c 20 28 61 73 20 | 73 70 65 63 69 66 69 65 |vel (as |specifie|
|00002100| 64 20 62 79 20 63 61 6c | 6c 73 20 74 6f 20 6d 61 |d by cal|ls to ma|
|00002110| 6c 6c 6f 70 74 20 6f 72 | 20 76 69 61 20 65 6e 76 |llopt or| via env|
|00002120| 69 72 6f 6e 6d 65 6e 74 | 0a 58 76 61 72 69 61 62 |ironment|.Xvariab|
|00002130| 6c 65 73 29 2e 20 20 54 | 68 65 20 63 6f 64 69 6e |les). T|he codin|
|00002140| 67 20 66 6f 72 20 74 68 | 65 20 65 72 72 6f 72 20 |g for th|e error |
|00002150| 68 61 6e 64 6c 69 6e 67 | 20 69 73 20 61 73 20 66 |handling| is as f|
|00002160| 6f 6c 6c 6f 77 73 3a 0a | 58 2e 4d 50 0a 58 2e 56 |ollows:.|X.MP.X.V|
|00002170| 4c 20 33 0a 58 2e 4c 49 | 20 22 5c 30 5c 30 30 22 |L 3.X.LI| "\0\00"|
|00002180| 0a 58 63 6f 6e 74 69 6e | 75 65 20 6f 70 65 72 61 |.Xcontin|ue opera|
|00002190| 74 69 6f 6e 73 0a 58 2e | 4c 49 20 22 5c 30 5c 30 |tions.X.|LI "\0\0|
|000021a0| 31 22 0a 58 64 72 6f 70 | 20 63 6f 72 65 20 61 6e |1".Xdrop| core an|
|000021b0| 64 20 65 78 69 74 0a 58 | 2e 4c 49 20 22 5c 30 5c |d exit.X|.LI "\0\|
|000021c0| 30 32 22 0a 58 6a 75 73 | 74 20 65 78 69 74 0a 58 |02".Xjus|t exit.X|
|000021d0| 2e 4c 49 20 22 5c 30 5c | 30 33 22 0a 58 64 72 6f |.LI "\0\|03".Xdro|
|000021e0| 70 20 63 6f 72 65 2c 20 | 62 75 74 20 63 6f 6e 74 |p core, |but cont|
|000021f0| 69 6e 75 65 20 65 78 65 | 63 75 74 69 6e 67 2e 20 |inue exe|cuting. |
|00002200| 20 43 6f 72 65 20 66 69 | 6c 65 73 20 77 69 6c 6c | Core fi|les will|
|00002210| 0a 58 62 65 20 70 6c 61 | 63 65 64 20 69 6e 74 6f |.Xbe pla|ced into|
|00002220| 20 63 6f 72 65 2e 5b 50 | 49 44 5d 2e 5b 63 6f 75 | core.[P|ID].[cou|
|00002230| 6e 74 65 72 5d 20 69 2e | 65 3a 20 63 6f 72 65 2e |nter] i.|e: core.|
|00002240| 30 30 31 32 33 2e 30 30 | 31 0a 58 2e 4c 49 20 22 |00123.00|1.X.LI "|
|00002250| 31 32 38 22 0a 58 64 75 | 6d 70 20 6d 61 6c 6c 6f |128".Xdu|mp mallo|
|00002260| 63 20 63 68 61 69 6e 20 | 61 6e 64 20 63 6f 6e 74 |c chain |and cont|
|00002270| 69 6e 75 65 0a 58 2e 4c | 49 20 22 31 32 39 22 0a |inue.X.L|I "129".|
|00002280| 58 64 75 6d 70 20 6d 61 | 6c 6c 6f 63 20 63 68 61 |Xdump ma|lloc cha|
|00002290| 69 6e 2c 20 64 75 6d 70 | 20 63 6f 72 65 2c 20 61 |in, dump| core, a|
|000022a0| 6e 64 20 65 78 69 74 0a | 58 2e 4c 49 20 22 31 33 |nd exit.|X.LI "13|
|000022b0| 30 22 0a 58 64 75 6d 70 | 20 6d 61 6c 6c 6f 63 20 |0".Xdump| malloc |
|000022c0| 63 68 61 69 6e 2c 20 65 | 78 69 74 0a 58 2e 4c 49 |chain, e|xit.X.LI|
|000022d0| 20 22 31 33 31 22 0a 58 | 64 75 6d 70 20 6d 61 6c | "131".X|dump mal|
|000022e0| 6c 6f 63 20 63 68 61 69 | 6e 2c 20 64 75 6d 70 20 |loc chai|n, dump |
|000022f0| 63 6f 72 65 2c 20 63 6f | 6e 74 69 6e 75 65 20 70 |core, co|ntinue p|
|00002300| 72 6f 63 65 73 73 69 6e | 67 0a 58 2e 4c 45 0a 58 |rocessin|g.X.LE.X|
|00002310| 2e 50 0a 58 5c 66 42 64 | 62 6d 61 6c 6c 6f 70 74 |.P.X\fBd|bmallopt|
|00002320| 5c 66 50 28 29 20 69 73 | 20 75 73 65 64 20 74 6f |\fP() is| used to|
|00002330| 20 73 65 74 20 74 68 65 | 20 6d 61 6c 6c 6f 63 20 | set the| malloc |
|00002340| 64 65 62 75 67 67 69 6e | 67 20 6f 70 74 69 6f 6e |debuggin|g option|
|00002350| 73 2e 20 54 68 65 0a 58 | 66 6f 6c 6c 6f 77 69 6e |s. The.X|followin|
|00002360| 67 20 6f 70 74 69 6f 6e | 73 20 63 61 6e 20 62 65 |g option|s can be|
|00002370| 20 73 65 74 3a 0a 58 2e | 4d 50 0a 58 2e 56 4c 20 | set:.X.|MP.X.VL |
|00002380| 31 30 0a 58 2e 4c 49 20 | 22 5c 73 2d 32 4d 41 4c |10.X.LI |"\s-2MAL|
|00002390| 4c 4f 43 5f 57 41 52 4e | 5c 73 2b 32 22 0a 58 73 |LOC_WARN|\s+2".Xs|
|000023a0| 65 74 20 74 68 65 20 65 | 72 72 6f 72 20 68 61 6e |et the e|rror han|
|000023b0| 64 6c 69 6e 67 20 66 6f | 72 20 77 61 72 6e 69 6e |dling fo|r warnin|
|000023c0| 67 20 6c 65 76 65 6c 20 | 65 72 72 6f 72 73 2e 20 |g level |errors. |
|000023d0| 20 5c 66 42 76 61 6c 2e | 69 5c 66 50 20 69 73 0a | \fBval.|i\fP is.|
|000023e0| 58 61 6e 20 69 6e 74 65 | 67 65 72 20 74 68 61 74 |Xan inte|ger that|
|000023f0| 20 63 61 6e 20 63 6f 6e | 74 61 69 6e 20 61 6e 79 | can con|tain any|
|00002400| 20 6f 6e 65 20 6f 66 20 | 74 68 65 20 66 6f 6c 6c | one of |the foll|
|00002410| 6f 77 69 6e 67 20 76 61 | 6c 75 65 73 3a 0a 58 2e |owing va|lues:.X.|
|00002420| 4d 50 0a 58 2e 56 4c 20 | 31 30 0a 58 2e 4c 49 20 |MP.X.VL |10.X.LI |
|00002430| 22 5c 73 2d 32 4d 5f 48 | 41 4e 44 4c 45 5f 49 47 |"\s-2M_H|ANDLE_IG|
|00002440| 4e 4f 52 45 5c 73 2b 32 | 22 0a 58 69 67 6e 6f 72 |NORE\s+2|".Xignor|
|00002450| 65 20 65 72 72 6f 72 20 | 28 6a 75 73 74 20 64 69 |e error |(just di|
|00002460| 73 70 6c 61 79 20 77 61 | 72 6e 69 6e 67 20 6d 65 |splay wa|rning me|
|00002470| 73 73 61 67 65 20 61 6e | 64 20 63 6f 6e 74 69 6e |ssage an|d contin|
|00002480| 75 65 20 70 72 6f 63 65 | 73 73 69 6e 67 29 0a 58 |ue proce|ssing).X|
|00002490| 2e 4c 49 20 22 5c 73 2d | 32 4d 5f 48 41 4e 44 4c |.LI "\s-|2M_HANDL|
|000024a0| 45 5f 41 42 4f 52 54 5c | 73 2b 32 22 0a 58 64 72 |E_ABORT\|s+2".Xdr|
|000024b0| 6f 70 20 63 6f 72 65 20 | 61 6e 64 20 65 78 69 74 |op core |and exit|
|000024c0| 0a 58 2e 4c 49 20 22 5c | 73 2d 32 4d 5f 48 41 4e |.X.LI "\|s-2M_HAN|
|000024d0| 44 4c 45 5f 45 58 49 54 | 5c 73 2b 32 22 0a 58 6a |DLE_EXIT|\s+2".Xj|
|000024e0| 75 73 74 20 65 78 69 74 | 20 28 6e 6f 20 63 6f 72 |ust exit| (no cor|
|000024f0| 65 20 64 72 6f 70 29 0a | 58 2e 4c 49 20 22 5c 73 |e drop).|X.LI "\s|
|00002500| 2d 32 4d 5f 48 41 4e 44 | 4c 45 5f 43 4f 52 45 5c |-2M_HAND|LE_CORE\|
|00002510| 73 2b 32 22 0a 58 64 72 | 6f 70 20 63 6f 72 65 2c |s+2".Xdr|op core,|
|00002520| 20 62 75 74 20 6b 65 65 | 70 20 6f 6e 20 67 6f 69 | but kee|p on goi|
|00002530| 6e 67 0a 58 2e 4c 45 0a | 58 2e 4d 50 0a 58 49 6e |ng.X.LE.|X.MP.XIn|
|00002540| 20 61 64 64 69 74 69 6f | 6e 2c 20 5c 73 2d 32 4d | additio|n, \s-2M|
|00002550| 5f 48 41 4e 44 4c 45 5f | 44 55 4d 50 5c 73 2b 32 |_HANDLE_|DUMP\s+2|
|00002560| 20 6d 61 79 20 62 65 20 | 6f 72 27 64 20 69 6e 20 | may be |or'd in |
|00002570| 74 6f 20 63 61 75 73 65 | 20 61 20 64 75 6d 70 0a |to cause| a dump.|
|00002580| 58 6f 66 20 74 68 65 20 | 63 75 72 72 65 6e 74 20 |Xof the |current |
|00002590| 6d 61 6c 6c 6f 63 20 63 | 68 61 69 6e 2e 0a 58 2e |malloc c|hain..X.|
|000025a0| 4d 50 0a 58 54 68 65 20 | 64 65 66 61 75 6c 74 20 |MP.XThe |default |
|000025b0| 61 63 74 69 6f 6e 20 66 | 6f 72 20 5c 73 2d 32 4d |action f|or \s-2M|
|000025c0| 41 4c 4c 4f 43 5f 57 41 | 52 4e 5c 73 2b 32 20 69 |ALLOC_WA|RN\s+2 i|
|000025d0| 73 20 5c 73 2d 32 4d 5f | 48 41 4e 44 4c 45 5f 49 |s \s-2M_|HANDLE_I|
|000025e0| 47 4e 4f 52 45 5c 73 2b | 32 2e 0a 58 2e 4d 50 0a |GNORE\s+|2..X.MP.|
|000025f0| 58 2e 4c 49 20 22 5c 73 | 2d 32 4d 41 4c 4c 4f 43 |X.LI "\s|-2MALLOC|
|00002600| 5f 46 41 54 41 4c 5c 73 | 2b 32 22 0a 58 73 65 74 |_FATAL\s|+2".Xset|
|00002610| 20 74 68 65 20 65 72 72 | 6f 72 20 68 61 6e 64 6c | the err|or handl|
|00002620| 69 6e 67 20 66 6f 72 20 | 66 61 74 61 6c 20 6c 65 |ing for |fatal le|
|00002630| 76 65 6c 20 65 72 72 6f | 72 73 2e 20 20 5c 66 42 |vel erro|rs. \fB|
|00002640| 76 61 6c 2e 69 5c 66 50 | 20 69 73 0a 58 65 71 75 |val.i\fP| is.Xequ|
|00002650| 69 76 61 6c 65 6e 74 20 | 74 6f 20 5c 66 42 76 61 |ivalent |to \fBva|
|00002660| 6c 2e 69 5c 66 50 20 66 | 6f 72 20 5c 73 2d 32 4d |l.i\fP f|or \s-2M|
|00002670| 41 4c 4c 4f 43 5f 57 41 | 52 4e 5c 73 2b 32 2e 0a |ALLOC_WA|RN\s+2..|
|00002680| 58 2e 4d 50 0a 58 54 68 | 65 20 64 65 66 61 75 6c |X.MP.XTh|e defaul|
|00002690| 74 20 61 63 74 69 6f 6e | 20 66 6f 72 20 5c 73 2d |t action| for \s-|
|000026a0| 32 4d 41 4c 4c 4f 43 5f | 46 41 54 41 4c 5c 73 2b |2MALLOC_|FATAL\s+|
|000026b0| 32 20 69 73 20 5c 73 2d | 32 4d 5f 48 41 4e 44 4c |2 is \s-|2M_HANDL|
|000026c0| 45 5f 41 42 4f 52 54 5c | 73 2b 32 2e 0a 58 2e 4d |E_ABORT\|s+2..X.M|
|000026d0| 50 0a 58 2e 4c 49 20 22 | 5c 73 2d 32 4d 41 4c 4c |P.X.LI "|\s-2MALL|
|000026e0| 4f 43 5f 45 52 52 46 49 | 4c 45 5c 73 2b 32 22 0a |OC_ERRFI|LE\s+2".|
|000026f0| 58 73 65 74 20 74 68 65 | 20 64 65 73 74 69 6e 61 |Xset the| destina|
|00002700| 74 69 6f 6e 20 66 6f 72 | 20 6d 61 6c 6c 6f 63 20 |tion for| malloc |
|00002710| 65 72 72 6f 72 20 6d 65 | 73 73 61 67 65 73 2e 20 |error me|ssages. |
|00002720| 20 5c 66 42 76 61 6c 2e | 73 74 72 5c 66 50 0a 58 | \fBval.|str\fP.X|
|00002730| 69 73 20 61 20 70 6f 69 | 6e 74 65 72 20 74 6f 20 |is a poi|nter to |
|00002740| 61 20 63 68 61 72 61 63 | 74 65 72 20 73 74 72 69 |a charac|ter stri|
|00002750| 6e 67 20 63 6f 6e 74 61 | 69 6e 69 6e 67 20 74 68 |ng conta|ining th|
|00002760| 65 20 6e 61 6d 65 20 6f | 66 20 74 68 65 20 66 69 |e name o|f the fi|
|00002770| 6c 65 20 74 6f 20 62 65 | 20 75 73 65 64 0a 58 66 |le to be| used.Xf|
|00002780| 6f 72 20 65 72 72 6f 72 | 20 6d 65 73 73 61 67 65 |or error| message|
|00002790| 73 2e 20 20 4e 6f 74 65 | 20 74 68 61 74 20 65 72 |s. Note| that er|
|000027a0| 72 6f 72 20 6d 65 73 73 | 61 67 65 73 20 61 72 65 |ror mess|ages are|
|000027b0| 20 5c 73 2d 31 41 50 50 | 45 4e 44 45 44 5c 73 2b | \s-1APP|ENDED\s+|
|000027c0| 31 20 74 6f 20 74 68 69 | 73 0a 58 66 69 6c 65 2c |1 to thi|s.Xfile,|
|000027d0| 20 73 6f 20 65 78 69 73 | 74 69 6e 67 20 65 72 72 | so exis|ting err|
|000027e0| 6f 72 20 6d 65 73 73 61 | 67 65 73 20 77 69 6c 6c |or messa|ges will|
|000027f0| 20 6e 6f 74 20 62 65 20 | 72 65 6d 6f 76 65 64 2e | not be |removed.|
|00002800| 0a 58 2e 4d 50 0a 58 49 | 66 20 5c 73 2d 32 4d 41 |.X.MP.XI|f \s-2MA|
|00002810| 4c 4c 4f 43 5f 45 52 52 | 46 49 4c 45 5c 73 2b 32 |LLOC_ERR|FILE\s+2|
|00002820| 20 69 73 20 6e 6f 74 20 | 73 65 74 2c 20 61 6c 6c | is not |set, all|
|00002830| 20 65 72 72 6f 72 20 6d | 65 73 73 61 67 65 73 20 | error m|essages |
|00002840| 77 69 6c 6c 20 62 65 20 | 73 65 6e 74 0a 58 74 6f |will be |sent.Xto|
|00002850| 20 5c 66 42 73 74 64 65 | 72 72 5c 66 50 2e 0a 58 | \fBstde|rr\fP..X|
|00002860| 2e 4d 50 0a 58 2e 6e 65 | 20 33 0a 58 2e 4c 49 20 |.MP.X.ne| 3.X.LI |
|00002870| 22 5c 73 2d 32 4d 41 4c | 4c 4f 43 5f 43 4b 43 48 |"\s-2MAL|LOC_CKCH|
|00002880| 41 49 4e 5c 73 2b 32 22 | 0a 58 73 65 74 20 74 68 |AIN\s+2"|.Xset th|
|00002890| 65 20 6d 61 6c 6c 6f 63 | 20 63 68 61 69 6e 20 63 |e malloc| chain c|
|000028a0| 68 65 63 6b 69 6e 67 20 | 66 6c 61 67 2e 20 20 49 |hecking |flag. I|
|000028b0| 66 20 5c 66 42 76 61 6c | 2e 69 5c 66 50 20 69 73 |f \fBval|.i\fP is|
|000028c0| 0a 58 6e 6f 6e 2d 7a 65 | 72 6f 2c 20 63 68 61 69 |.Xnon-ze|ro, chai|
|000028d0| 6e 20 63 68 65 63 6b 69 | 6e 67 20 61 74 20 65 76 |n checki|ng at ev|
|000028e0| 65 72 79 20 63 61 6c 6c | 20 74 6f 20 6d 61 6c 6c |ery call| to mall|
|000028f0| 6f 63 20 69 73 20 74 75 | 72 6e 65 64 20 6f 6e 2e |oc is tu|rned on.|
|00002900| 20 54 68 65 20 0a 58 64 | 65 66 61 75 6c 74 20 62 | The .Xd|efault b|
|00002910| 65 68 61 76 69 6f 72 20 | 69 73 20 74 6f 20 6e 6f |ehavior |is to no|
|00002920| 74 20 63 68 65 63 6b 20 | 74 68 65 20 63 68 61 69 |t check |the chai|
|00002930| 6e 20 61 74 20 65 61 63 | 68 20 63 61 6c 6c 20 74 |n at eac|h call t|
|00002940| 6f 20 6d 61 6c 6c 6f 63 | 20 62 65 63 61 75 73 65 |o malloc| because|
|00002950| 0a 58 6f 66 20 70 65 72 | 66 6f 72 6d 61 6e 63 65 |.Xof per|formance|
|00002960| 20 69 73 73 75 65 73 20 | 28 74 68 65 20 6c 69 62 | issues |(the lib|
|00002970| 72 61 72 79 20 69 73 20 | 63 6f 6e 73 69 64 65 72 |rary is |consider|
|00002980| 61 62 6c 79 20 73 6c 6f | 77 65 72 20 77 68 65 6e |ably slo|wer when|
|00002990| 20 74 68 69 73 20 0a 58 | 66 75 6e 63 74 69 6f 6e | this .X|function|
|000029a0| 20 69 73 20 65 6e 61 62 | 6c 65 64 29 2e 0a 58 2e | is enab|led)..X.|
|000029b0| 4d 50 0a 58 2e 6e 65 20 | 31 30 0a 58 2e 4c 49 20 |MP.X.ne |10.X.LI |
|000029c0| 22 5c 73 2d 32 4d 41 4c | 4c 4f 43 5f 46 52 45 45 |"\s-2MAL|LOC_FREE|
|000029d0| 4d 41 52 4b 5c 73 2b 32 | 22 0a 58 73 65 74 73 20 |MARK\s+2|".Xsets |
|000029e0| 74 68 65 20 62 65 68 61 | 76 69 6f 72 20 6f 66 20 |the beha|vior of |
|000029f0| 66 72 65 65 69 6e 67 20 | 6f 66 20 6d 61 72 6b 65 |freeing |of marke|
|00002a00| 64 20 61 72 65 61 73 2e | 20 20 42 79 20 64 65 66 |d areas.| By def|
|00002a10| 61 75 6c 74 2c 20 61 20 | 66 72 65 65 20 6f 66 20 |ault, a |free of |
|00002a20| 61 20 0a 58 6d 61 72 6b | 65 64 20 73 65 67 6d 65 |a .Xmark|ed segme|
|00002a30| 6e 74 20 67 65 6e 65 72 | 61 74 65 73 20 61 20 77 |nt gener|ates a w|
|00002a40| 61 72 6e 69 6e 67 2e 20 | 20 49 66 20 5c 66 42 76 |arning. | If \fBv|
|00002a50| 61 6c 2e 69 5c 66 50 20 | 69 73 20 7a 65 72 6f 2c |al.i\fP |is zero,|
|00002a60| 20 77 61 72 6e 69 6e 67 | 73 20 77 69 6c 6c 0a 58 | warning|s will.X|
|00002a70| 6e 6f 74 20 62 65 20 67 | 65 6e 65 72 61 74 65 64 |not be g|enerated|
|00002a80| 2e 0a 58 2e 4d 50 0a 58 | 2e 6e 65 20 31 30 0a 58 |..X.MP.X|.ne 10.X|
|00002a90| 2e 4c 49 20 22 5c 73 2d | 32 4d 41 4c 4c 4f 43 5f |.LI "\s-|2MALLOC_|
|00002aa0| 46 49 4c 4c 41 52 45 41 | 5c 73 2b 32 22 0a 58 73 |FILLAREA|\s+2".Xs|
|00002ab0| 65 74 20 74 68 65 20 6d | 61 6c 6c 6f 63 20 66 69 |et the m|alloc fi|
|00002ac0| 6c 6c 20 61 72 65 61 20 | 66 6c 61 67 2e 20 20 5c |ll area |flag. \|
|00002ad0| 66 42 76 61 6c 2e 69 5c | 66 50 20 73 70 65 63 69 |fBval.i\|fP speci|
|00002ae0| 66 69 65 73 20 74 68 65 | 20 6d 61 6c 6c 6f 63 20 |fies the| malloc |
|00002af0| 66 69 6c 6c 69 6e 67 0a | 58 6d 6f 64 65 20 74 6f |filling.|Xmode to|
|00002b00| 20 62 65 20 75 73 65 64 | 2e 20 20 20 54 68 65 72 | be used|. Ther|
|00002b10| 65 20 61 72 65 20 66 6f | 75 72 20 6d 6f 64 65 73 |e are fo|ur modes|
|00002b20| 3a 20 30 2c 20 31 2c 20 | 32 20 61 6e 64 20 33 2e |: 0, 1, |2 and 3.|
|00002b30| 20 20 4d 6f 64 65 20 30 | 20 64 69 73 61 62 6c 65 | Mode 0| disable|
|00002b40| 73 0a 58 61 6c 6c 20 66 | 69 6c 6c 69 6e 67 20 61 |s.Xall f|illing a|
|00002b50| 6e 64 20 63 68 65 63 6b | 69 6e 67 20 6f 66 20 66 |nd check|ing of f|
|00002b60| 69 6c 6c 65 64 20 61 72 | 65 61 73 20 28 74 68 65 |illed ar|eas (the|
|00002b70| 72 65 62 79 20 72 65 64 | 75 63 69 6e 67 20 74 68 |reby red|ucing th|
|00002b80| 65 20 65 66 66 65 63 74 | 69 76 65 6e 65 73 73 0a |e effect|iveness.|
|00002b90| 58 6f 66 20 74 68 65 20 | 6c 69 62 72 61 72 79 29 |Xof the |library)|
|00002ba0| 2e 20 20 4d 6f 64 65 20 | 31 20 65 6e 61 62 6c 65 |. Mode |1 enable|
|00002bb0| 73 20 74 68 65 20 66 69 | 6c 6c 69 6e 67 20 6f 66 |s the fi|lling of|
|00002bc0| 20 62 6f 75 6e 64 61 72 | 79 20 61 72 65 61 73 20 | boundar|y areas |
|00002bd0| 62 65 66 6f 72 65 20 61 | 6e 64 0a 58 61 66 74 65 |before a|nd.Xafte|
|00002be0| 72 20 74 68 65 20 61 6c | 6c 6f 63 61 74 69 6f 6e |r the al|location|
|00002bf0| 20 61 72 65 61 73 20 77 | 68 69 63 68 20 61 72 65 | areas w|hich are|
|00002c00| 20 75 73 65 64 20 74 6f | 20 63 68 65 63 6b 20 66 | used to| check f|
|00002c10| 6f 72 20 77 72 69 74 69 | 6e 67 20 62 65 66 6f 72 |or writi|ng befor|
|00002c20| 65 0a 58 6f 72 20 61 66 | 74 65 72 20 74 68 65 20 |e.Xor af|ter the |
|00002c30| 70 6f 69 6e 74 65 72 2e | 20 20 4d 6f 64 65 20 32 |pointer.| Mode 2|
|00002c40| 20 69 6e 63 6c 75 64 65 | 73 20 6d 6f 64 65 20 31 | include|s mode 1|
|00002c50| 20 61 6e 64 20 61 64 64 | 73 20 74 68 65 20 66 69 | and add|s the fi|
|00002c60| 6c 6c 69 6e 67 20 6f 66 | 0a 58 6d 61 6c 6c 6f 63 |lling of|.Xmalloc|
|00002c70| 65 64 20 72 65 67 69 6f | 6e 73 20 77 69 74 68 20 |ed regio|ns with |
|00002c80| 61 20 73 70 65 63 69 66 | 69 65 64 20 66 69 6c 6c |a specif|ied fill|
|00002c90| 20 70 61 74 74 65 72 6e | 20 73 6f 20 74 68 61 74 | pattern| so that|
|00002ca0| 20 61 20 70 72 6f 67 72 | 61 6d 20 64 6f 65 73 20 | a progr|am does |
|00002cb0| 6e 6f 74 0a 58 64 65 70 | 65 6e 64 20 75 70 6f 6e |not.Xdep|end upon|
|00002cc0| 20 6d 61 6c 6c 6f 63 65 | 64 20 72 65 67 69 6f 6e | malloce|d region|
|00002cd0| 73 20 74 6f 20 62 65 20 | 66 69 6c 6c 65 64 20 77 |s to be |filled w|
|00002ce0| 69 74 68 20 7a 65 72 6f | 73 2e 20 20 4d 6f 64 65 |ith zero|s. Mode|
|00002cf0| 20 33 20 69 6e 63 6c 75 | 64 65 73 0a 58 61 6c 6c | 3 inclu|des.Xall|
|00002d00| 20 6f 66 20 6d 6f 64 65 | 20 32 20 61 6e 64 20 61 | of mode| 2 and a|
|00002d10| 64 64 73 20 74 68 65 20 | 66 69 6c 6c 69 6e 67 20 |dds the |filling |
|00002d20| 6f 66 20 66 72 65 65 27 | 64 20 72 65 67 69 6f 6e |of free'|d region|
|00002d30| 73 20 73 6f 20 74 68 61 | 74 20 61 6e 20 61 74 74 |s so tha|t an att|
|00002d40| 65 6d 70 74 0a 58 74 6f | 20 75 73 65 64 20 61 20 |empt.Xto| used a |
|00002d50| 66 72 65 65 64 20 64 61 | 74 61 20 61 72 65 61 20 |freed da|ta area |
|00002d60| 77 69 6c 6c 20 72 65 73 | 75 6c 74 20 69 6e 20 61 |will res|ult in a|
|00002d70| 6e 20 65 72 72 6f 72 2e | 0a 58 2e 4d 50 0a 58 41 |n error.|.X.MP.XA|
|00002d80| 73 20 66 61 72 20 61 73 | 20 70 65 72 66 6f 72 6d |s far as| perform|
|00002d90| 61 6e 63 65 20 69 73 20 | 63 6f 6e 63 65 72 6e 65 |ance is |concerne|
|00002da0| 64 2c 20 6d 6f 64 65 20 | 30 20 77 69 6c 6c 20 62 |d, mode |0 will b|
|00002db0| 65 20 74 68 65 20 66 61 | 73 74 65 73 74 20 6d 6f |e the fa|stest mo|
|00002dc0| 64 65 2c 20 0a 58 77 68 | 69 6c 65 20 28 73 6f 6d |de, .Xwh|ile (som|
|00002dd0| 65 77 68 61 74 20 75 6e | 65 78 70 65 63 74 65 64 |ewhat un|expected|
|00002de0| 6c 79 29 20 6d 6f 64 65 | 20 33 20 69 73 20 74 68 |ly) mode| 3 is th|
|00002df0| 65 20 6e 65 78 74 20 22 | 66 61 73 74 65 73 74 22 |e next "|fastest"|
|00002e00| 20 6d 6f 64 65 20 0a 58 | 77 69 74 68 20 6d 6f 64 | mode .X|with mod|
|00002e10| 65 20 31 20 62 72 69 6e | 67 20 75 70 20 74 68 65 |e 1 brin|g up the|
|00002e20| 20 74 61 69 6c 20 65 6e | 64 2e 20 0a 58 2e 4d 50 | tail en|d. .X.MP|
|00002e30| 0a 58 54 68 65 20 64 65 | 66 61 75 6c 74 20 62 65 |.XThe de|fault be|
|00002e40| 68 61 76 69 6f 72 20 66 | 6f 72 20 5c 73 2d 32 4d |havior f|or \s-2M|
|00002e50| 41 4c 4c 4f 43 5f 46 49 | 4c 4c 41 52 45 41 5c 73 |ALLOC_FI|LLAREA\s|
|00002e60| 2b 32 20 69 73 20 6d 6f | 64 65 20 33 2e 0a 58 2e |+2 is mo|de 3..X.|
|00002e70| 4d 50 0a 58 2e 4c 49 20 | 22 5c 73 2d 32 4d 41 4c |MP.X.LI |"\s-2MAL|
|00002e80| 4c 4f 43 5f 4c 4f 57 46 | 52 41 47 5c 73 2b 32 22 |LOC_LOWF|RAG\s+2"|
|00002e90| 0a 58 73 65 74 20 74 68 | 65 20 6d 61 6c 6c 6f 63 |.Xset th|e malloc|
|00002ea0| 20 61 6c 6c 6f 63 61 74 | 69 6f 6e 20 66 72 61 67 | allocat|ion frag|
|00002eb0| 6d 65 6e 74 61 74 69 6f | 6e 20 68 61 6e 64 6c 69 |mentatio|n handli|
|00002ec0| 6e 67 20 6c 65 76 65 6c | 2e 20 20 42 79 20 64 65 |ng level|. By de|
|00002ed0| 66 61 75 6c 74 2c 20 6d | 61 6c 6c 6f 63 0a 58 75 |fault, m|alloc.Xu|
|00002ee0| 73 65 73 20 61 20 66 69 | 72 73 74 20 66 69 74 20 |ses a fi|rst fit |
|00002ef0| 61 6c 67 6f 72 69 74 68 | 6d 20 66 6f 72 20 6e 65 |algorith|m for ne|
|00002f00| 77 20 61 6c 6c 6f 63 61 | 74 69 6f 6e 73 2e 20 20 |w alloca|tions. |
|00002f10| 55 6e 64 65 72 20 63 65 | 72 74 61 69 6e 20 61 6c |Under ce|rtain al|
|00002f20| 6c 6f 63 61 74 69 6f 6e | 0a 58 73 63 65 6e 61 72 |location|.Xscenar|
|00002f30| 69 6f 73 2c 20 74 68 69 | 73 20 63 61 6e 20 6c 65 |ios, thi|s can le|
|00002f40| 61 64 20 74 6f 20 73 69 | 67 6e 69 66 69 63 61 6e |ad to si|gnifican|
|00002f50| 74 20 6d 65 6d 6f 72 79 | 20 66 72 61 67 6d 65 6e |t memory| fragmen|
|00002f60| 74 61 74 69 6f 6e 20 62 | 65 63 61 75 73 65 20 6f |tation b|ecause o|
|00002f70| 66 0a 58 74 68 65 20 66 | 61 63 74 20 74 68 61 74 |f.Xthe f|act that|
|00002f80| 20 6c 69 74 74 6c 65 20 | 61 6c 6c 6f 63 61 74 69 | little |allocati|
|00002f90| 6f 6e 73 20 63 61 6e 20 | 62 72 65 61 6b 20 62 69 |ons can |break bi|
|00002fa0| 67 20 62 6c 6f 63 6b 73 | 20 75 70 2e 0a 58 2e 4d |g blocks| up..X.M|
|00002fb0| 50 0a 58 49 66 20 5c 66 | 42 76 61 6c 2e 69 5c 66 |P.XIf \f|Bval.i\f|
|00002fc0| 50 20 69 73 20 6e 6f 6e | 2d 7a 65 72 6f 2c 20 6d |P is non|-zero, m|
|00002fd0| 61 6c 6c 6f 63 20 75 73 | 65 73 20 61 20 62 65 73 |alloc us|es a bes|
|00002fe0| 74 20 66 69 74 20 61 6c | 67 6f 72 69 74 68 6d 20 |t fit al|gorithm |
|00002ff0| 77 68 69 63 68 20 77 69 | 6c 6c 20 72 65 64 75 63 |which wi|ll reduc|
|00003000| 65 0a 58 66 72 61 67 6d | 65 6e 74 61 74 69 6f 6e |e.Xfragm|entation|
|00003010| 2e 20 20 54 68 69 73 20 | 6d 65 63 68 61 6e 69 73 |. This |mechanis|
|00003020| 6d 2c 20 77 68 69 6c 65 | 20 75 73 69 6e 67 20 6c |m, while| using l|
|00003030| 65 73 73 20 6d 65 6d 6f | 72 79 2c 20 69 73 20 73 |ess memo|ry, is s|
|00003040| 6c 6f 77 65 72 20 62 65 | 63 61 75 73 65 0a 58 74 |lower be|cause.Xt|
|00003050| 68 65 20 65 6e 74 69 72 | 65 20 66 72 65 65 20 6c |he entir|e free l|
|00003060| 69 73 74 20 69 73 20 63 | 68 65 63 6b 65 64 20 69 |ist is c|hecked i|
|00003070| 6e 73 74 65 61 64 20 6f | 66 20 6a 75 73 74 20 63 |nstead o|f just c|
|00003080| 68 65 63 6b 69 6e 67 20 | 75 6e 74 69 6c 20 77 65 |hecking |until we|
|00003090| 20 66 69 6e 64 20 61 0a | 58 73 65 67 6d 65 6e 74 | find a.|Xsegment|
|000030a0| 20 74 68 61 74 20 69 73 | 20 61 74 20 6c 65 61 73 | that is| at leas|
|000030b0| 74 20 62 69 67 20 65 6e | 6f 75 67 68 2e 20 20 4e |t big en|ough. N|
|000030c0| 6f 72 6d 61 6c 6c 79 20 | 79 6f 75 20 77 69 6c 6c |ormally |you will|
|000030d0| 20 6e 6f 74 20 6e 65 65 | 64 20 74 6f 20 73 65 74 | not nee|d to set|
|000030e0| 0a 58 74 68 69 73 20 76 | 61 72 69 61 62 6c 65 2e |.Xthis v|ariable.|
|000030f0| 0a 58 2e 4d 50 0a 58 2e | 4c 49 20 22 5c 73 2d 32 |.X.MP.X.|LI "\s-2|
|00003100| 4d 41 4c 4c 4f 43 5f 43 | 4b 44 41 54 41 5c 73 2b |MALLOC_C|KDATA\s+|
|00003110| 32 22 0a 58 65 6e 61 62 | 6c 65 2f 64 69 73 61 62 |2".Xenab|le/disab|
|00003120| 6c 65 20 74 68 65 20 63 | 68 65 63 6b 69 6e 67 20 |le the c|hecking |
|00003130| 6f 66 20 70 6f 69 6e 74 | 65 72 73 20 70 61 73 73 |of point|ers pass|
|00003140| 65 64 20 74 6f 20 74 68 | 65 20 6d 65 6d 6f 72 79 |ed to th|e memory|
|00003150| 20 28 6d 65 6d 2a 2c 62 | 2a 29 20 61 6e 64 20 0a | (mem*,b|*) and .|
|00003160| 58 73 74 72 69 6e 67 20 | 28 73 74 72 2a 29 20 66 |Xstring |(str*) f|
|00003170| 75 6e 63 74 69 6f 6e 73 | 2e 20 20 54 68 69 73 20 |unctions|. This |
|00003180| 63 61 6e 20 62 65 20 75 | 73 65 64 20 74 6f 20 73 |can be u|sed to s|
|00003190| 74 61 72 74 75 70 20 74 | 68 65 20 63 6f 64 65 20 |tartup t|he code |
|000031a0| 77 69 74 68 0a 58 63 68 | 65 63 6b 69 6e 67 20 64 |with.Xch|ecking d|
|000031b0| 69 73 61 62 6c 65 64 20 | 28 77 68 65 6e 20 79 6f |isabled |(when yo|
|000031c0| 75 20 6b 6e 6f 77 20 74 | 68 65 20 73 74 61 72 74 |u know t|he start|
|000031d0| 75 70 20 63 6f 64 65 20 | 69 73 20 66 75 6e 63 74 |up code |is funct|
|000031e0| 69 6f 6e 69 6e 67 20 63 | 6f 72 72 65 63 74 6c 79 |ioning c|orrectly|
|000031f0| 29 0a 58 61 6e 64 20 74 | 68 65 6e 20 74 75 72 6e |).Xand t|hen turn|
|00003200| 20 69 74 20 6f 6e 20 6c | 61 74 65 72 20 77 68 65 | it on l|ater whe|
|00003210| 6e 20 79 6f 75 20 67 65 | 74 20 69 6e 74 6f 20 74 |n you ge|t into t|
|00003220| 68 65 20 61 72 65 61 20 | 6f 66 20 74 68 65 20 63 |he area |of the c|
|00003230| 6f 64 65 20 74 68 61 74 | 20 69 73 20 0a 58 69 6e |ode that| is .Xin|
|00003240| 20 71 75 65 73 74 69 6f | 6e 2e 0a 58 2e 4d 50 0a | questio|n..X.MP.|
|00003250| 58 69 66 20 5c 66 42 76 | 61 6c 2e 69 5c 66 50 20 |Xif \fBv|al.i\fP |
|00003260| 69 73 20 6e 6f 6e 2d 7a | 65 72 6f 2c 20 70 6f 69 |is non-z|ero, poi|
|00003270| 6e 74 65 72 20 63 68 65 | 63 6b 69 6e 67 20 69 73 |nter che|cking is|
|00003280| 20 65 6e 61 62 6c 65 64 | 20 28 77 68 69 63 68 20 | enabled| (which |
|00003290| 69 73 20 74 68 65 20 64 | 65 66 61 75 6c 74 0a 58 |is the d|efault.X|
|000032a0| 6d 6f 64 65 29 2e 0a 58 | 2e 4d 50 0a 58 2e 4c 49 |mode)..X|.MP.X.LI|
|000032b0| 20 22 5c 73 2d 32 4d 41 | 4c 4c 4f 43 5f 52 45 55 | "\s-2MA|LLOC_REU|
|000032c0| 53 45 5c 73 2b 32 22 0a | 58 65 6e 61 62 6c 65 2f |SE\s+2".|Xenable/|
|000032d0| 64 69 73 61 62 6c 65 20 | 74 68 65 20 72 65 75 73 |disable |the reus|
|000032e0| 65 20 6f 66 20 66 72 65 | 65 64 20 73 65 67 6d 65 |e of fre|ed segme|
|000032f0| 6e 74 73 2e 20 20 54 68 | 69 73 20 6f 70 74 69 6f |nts. Th|is optio|
|00003300| 6e 20 63 61 6e 20 62 65 | 20 75 73 65 64 20 74 6f |n can be| used to|
|00003310| 20 0a 58 68 65 6c 70 20 | 69 64 65 6e 74 69 66 79 | .Xhelp |identify|
|00003320| 20 77 68 65 72 65 20 61 | 20 66 72 65 65 64 20 70 | where a| freed p|
|00003330| 6f 69 6e 74 65 72 20 69 | 73 20 62 65 69 6e 67 20 |ointer i|s being |
|00003340| 72 65 2d 75 73 65 64 2c | 20 6f 72 20 77 68 65 72 |re-used,| or wher|
|00003350| 65 20 69 74 20 69 73 20 | 62 65 69 6e 67 0a 58 66 |e it is |being.Xf|
|00003360| 72 65 65 64 20 61 20 73 | 65 63 6f 6e 64 20 74 69 |reed a s|econd ti|
|00003370| 6d 65 2c 20 73 69 6e 63 | 65 20 74 68 65 20 6c 6f |me, sinc|e the lo|
|00003380| 63 61 74 69 6f 6e 20 77 | 68 65 72 65 20 69 74 20 |cation w|here it |
|00003390| 77 61 73 20 66 72 65 65 | 64 20 69 73 20 61 6c 73 |was free|d is als|
|000033a0| 6f 20 6b 65 70 74 2e 0a | 58 2e 4d 50 0a 58 49 74 |o kept..|X.MP.XIt|
|000033b0| 20 73 68 6f 75 6c 64 20 | 62 65 20 6e 6f 74 65 64 | should |be noted|
|000033c0| 20 74 68 61 74 20 74 68 | 65 20 6d 65 6d 6f 72 79 | that th|e memory|
|000033d0| 20 72 65 71 75 69 72 65 | 6d 65 6e 74 73 20 66 6f | require|ments fo|
|000033e0| 72 20 61 20 70 72 6f 67 | 72 61 6d 20 77 69 6c 6c |r a prog|ram will|
|000033f0| 20 74 79 70 69 63 61 6c | 6c 79 0a 58 69 6e 63 72 | typical|ly.Xincr|
|00003400| 65 61 73 65 20 73 69 67 | 6e 69 66 69 63 61 6e 74 |ease sig|nificant|
|00003410| 6c 79 20 69 66 20 74 68 | 69 73 20 6f 70 74 69 6f |ly if th|is optio|
|00003420| 6e 20 69 73 20 75 73 65 | 64 2e 0a 58 2e 4d 50 0a |n is use|d..X.MP.|
|00003430| 58 69 66 20 5c 66 42 76 | 61 6c 2e 69 5c 66 50 20 |Xif \fBv|al.i\fP |
|00003440| 69 73 20 7a 65 72 6f 2c | 20 66 72 65 65 64 20 73 |is zero,| freed s|
|00003450| 65 67 6d 65 6e 74 73 20 | 61 72 65 20 6e 6f 74 20 |egments |are not |
|00003460| 72 65 75 73 65 64 20 66 | 6f 72 20 73 75 62 73 65 |reused f|or subse|
|00003470| 71 75 65 6e 74 0a 58 61 | 6c 6c 6f 63 61 74 69 6f |quent.Xa|llocatio|
|00003480| 6e 73 2e 20 20 20 49 66 | 20 6e 6f 6e 2d 7a 65 72 |ns. If| non-zer|
|00003490| 6f 2c 20 66 72 65 65 64 | 20 73 65 67 6d 65 6e 74 |o, freed| segment|
|000034a0| 73 20 63 61 6e 20 62 65 | 20 72 65 75 73 65 64 2e |s can be| reused.|
|000034b0| 20 20 49 66 20 66 72 65 | 65 64 20 73 65 67 6d 65 | If fre|ed segme|
|000034c0| 6e 74 73 0a 58 61 72 65 | 20 6e 6f 74 20 72 65 2d |nts.Xare| not re-|
|000034d0| 75 73 65 64 2c 20 79 6f | 75 20 6d 69 67 68 74 20 |used, yo|u might |
|000034e0| 77 61 6e 74 20 74 6f 20 | 64 69 73 61 62 6c 65 20 |want to |disable |
|000034f0| 66 69 6c 6c 69 6e 67 20 | 6f 66 20 66 72 65 65 64 |filling |of freed|
|00003500| 20 73 65 67 6d 65 6e 74 | 73 20 28 73 65 65 0a 58 | segment|s (see.X|
|00003510| 74 68 65 20 5c 73 2d 32 | 4d 41 4c 4c 4f 43 5f 46 |the \s-2|MALLOC_F|
|00003520| 49 4c 4c 41 52 45 41 5c | 73 2b 32 20 64 69 73 63 |ILLAREA\|s+2 disc|
|00003530| 75 73 73 69 6f 6e 73 29 | 20 73 6f 20 74 68 61 74 |ussions)| so that|
|00003540| 20 79 6f 75 20 63 61 6e | 20 73 65 65 20 74 68 65 | you can| see the|
|00003550| 20 64 61 74 61 20 69 6e | 20 74 68 65 0a 58 73 65 | data in| the.Xse|
|00003560| 67 6d 65 6e 74 20 2d 20 | 74 68 69 73 20 77 6f 75 |gment - |this wou|
|00003570| 6c 64 20 62 65 20 66 69 | 6c 6c 20 6d 6f 64 65 20 |ld be fi|ll mode |
|00003580| 32 20 6f 72 20 62 65 6c | 6f 77 2e 0a 58 2e 4c 45 |2 or bel|ow..X.LE|
|00003590| 0a 58 2e 4d 50 0a 58 2e | 6e 65 20 31 30 0a 58 46 |.X.MP.X.|ne 10.XF|
|000035a0| 6f 72 20 65 78 61 6d 70 | 6c 65 2c 20 74 6f 20 73 |or examp|le, to s|
|000035b0| 65 74 20 75 70 20 74 68 | 65 20 73 65 73 73 69 6f |et up th|e sessio|
|000035c0| 6e 20 74 6f 20 67 65 6e | 65 72 61 74 65 20 61 20 |n to gen|erate a |
|000035d0| 63 6f 72 65 20 66 69 6c | 65 20 66 6f 72 0a 58 65 |core fil|e for.Xe|
|000035e0| 76 65 72 79 20 6d 61 6c | 6c 6f 63 20 77 61 72 6e |very mal|loc warn|
|000035f0| 69 6e 67 2c 20 74 6f 20 | 64 72 6f 70 20 63 6f 72 |ing, to |drop cor|
|00003600| 65 20 61 6e 64 20 65 78 | 69 74 20 6f 6e 20 61 20 |e and ex|it on a |
|00003610| 6d 61 6c 6c 6f 63 20 66 | 61 74 61 6c 2c 20 61 6e |malloc f|atal, an|
|00003620| 64 20 0a 58 74 6f 20 6c | 6f 67 20 61 6c 6c 20 6d |d .Xto l|og all m|
|00003630| 65 73 73 61 67 65 73 20 | 74 6f 20 74 68 65 20 66 |essages |to the f|
|00003640| 69 6c 65 20 22 6d 61 6c | 6c 6f 63 5f 6c 6f 67 22 |ile "mal|loc_log"|
|00003650| 20 64 6f 20 74 68 65 20 | 66 6f 6c 6c 6f 77 69 6e | do the |followin|
|00003660| 67 3a 0a 58 2e 65 58 0a | 58 23 69 6e 63 6c 75 64 |g:.X.eX.|X#includ|
|00003670| 65 20 3c 6d 61 6c 6c 6f | 63 2e 68 3e 0a 58 75 6e |e <mallo|c.h>.Xun|
|00003680| 69 6f 6e 20 64 62 6d 61 | 6c 6c 6f 70 74 61 72 67 |ion dbma|lloptarg|
|00003690| 20 20 6d 3b 0a 58 0a 58 | 6d 2e 69 20 3d 20 4d 5f | m;.X.X|m.i = M_|
|000036a0| 48 41 4e 44 4c 45 5f 43 | 4f 52 45 20 7c 20 4d 5f |HANDLE_C|ORE | M_|
|000036b0| 48 41 4e 44 4c 45 5f 44 | 55 4d 50 3b 0a 58 64 62 |HANDLE_D|UMP;.Xdb|
|000036c0| 6d 61 6c 6c 6f 70 74 28 | 4d 41 4c 4c 4f 43 5f 57 |mallopt(|MALLOC_W|
|000036d0| 41 52 4e 2c 6d 29 3b 0a | 58 0a 58 6d 2e 69 20 3d |ARN,m);.|X.Xm.i =|
|000036e0| 20 4d 5f 48 41 4e 44 4c | 45 5f 41 42 4f 52 54 3b | M_HANDL|E_ABORT;|
|000036f0| 0a 58 64 62 6d 61 6c 6c | 6f 70 74 28 4d 41 4c 4c |.Xdbmall|opt(MALL|
|00003700| 4f 43 5f 46 41 54 41 4c | 2c 6d 29 3b 0a 58 0a 58 |OC_FATAL|,m);.X.X|
|00003710| 6d 2e 73 74 72 20 3d 20 | 22 6d 61 6c 6c 6f 63 5f |m.str = |"malloc_|
|00003720| 6c 6f 67 22 3b 0a 58 64 | 62 6d 61 6c 6c 6f 70 74 |log";.Xd|bmallopt|
|00003730| 28 4d 41 4c 4c 4f 43 5f | 45 52 52 46 49 4c 45 2c |(MALLOC_|ERRFILE,|
|00003740| 6d 29 3b 0a 58 2e 65 58 | 0a 58 5c 66 42 64 62 6d |m);.X.eX|.X\fBdbm|
|00003750| 61 6c 6c 6f 70 74 5c 66 | 50 28 29 20 63 61 6e 20 |allopt\f|P() can |
|00003760| 62 65 20 75 73 65 64 20 | 74 6f 20 73 65 74 2f 61 |be used |to set/a|
|00003770| 6c 74 65 72 20 74 68 65 | 20 64 65 62 75 67 67 69 |lter the| debuggi|
|00003780| 6e 67 20 6f 70 74 69 6f | 6e 73 20 61 74 20 61 6e |ng optio|ns at an|
|00003790| 79 0a 58 74 69 6d 65 20 | 28 69 2e 65 2e 20 79 6f |y.Xtime |(i.e. yo|
|000037a0| 75 20 6d 61 79 20 77 61 | 6e 74 20 74 6f 20 74 75 |u may wa|nt to tu|
|000037b0| 72 6e 20 6f 6e 20 63 68 | 61 69 6e 2d 63 68 65 63 |rn on ch|ain-chec|
|000037c0| 6b 69 6e 67 20 61 66 74 | 65 72 20 74 68 65 20 70 |king aft|er the p|
|000037d0| 72 6f 67 72 61 6d 20 73 | 74 61 72 74 75 70 20 69 |rogram s|tartup i|
|000037e0| 66 0a 58 74 68 65 20 70 | 72 6f 67 72 61 6d 20 73 |f.Xthe p|rogram s|
|000037f0| 74 61 72 74 75 70 20 64 | 6f 65 73 20 61 20 6c 6f |tartup d|oes a lo|
|00003800| 74 20 6f 66 20 61 6c 6c | 6f 63 61 74 69 6f 6e 73 |t of all|ocations|
|00003810| 20 77 68 69 63 68 20 61 | 72 65 20 6b 6e 6f 77 6e | which a|re known|
|00003820| 20 74 6f 20 62 65 20 4f | 4b 29 2e 0a 58 2e 50 0a | to be O|K)..X.P.|
|00003830| 58 2e 6e 65 20 35 0a 58 | 5c 66 42 6d 61 6c 6c 6f |X.ne 5.X|\fBmallo|
|00003840| 63 5f 63 68 61 69 6e 5f | 63 68 65 63 6b 5c 66 50 |c_chain_|check\fP|
|00003850| 28 29 20 77 69 6c 6c 20 | 63 68 65 63 6b 20 74 68 |() will |check th|
|00003860| 65 20 73 74 61 74 75 73 | 20 6f 66 20 74 68 65 20 |e status| of the |
|00003870| 6d 61 6c 6c 6f 63 20 61 | 72 65 6e 61 2e 0a 58 49 |malloc a|rena..XI|
|00003880| 66 20 5c 66 42 66 6c 61 | 67 5c 66 50 20 69 73 20 |f \fBfla|g\fP is |
|00003890| 6e 6f 6e 2d 7a 65 72 6f | 2c 20 61 6e 20 65 72 72 |non-zero|, an err|
|000038a0| 6f 72 20 66 6f 75 6e 64 | 20 69 6e 20 74 68 65 20 |or found| in the |
|000038b0| 63 68 61 69 6e 20 77 69 | 6c 6c 20 63 61 75 73 65 |chain wi|ll cause|
|000038c0| 20 61 20 0a 58 66 61 74 | 61 6c 20 65 72 72 6f 72 | a .Xfat|al error|
|000038d0| 2e 20 20 5c 66 42 6d 61 | 6c 6c 6f 63 5f 63 68 61 |. \fBma|lloc_cha|
|000038e0| 69 6e 5f 63 68 65 63 6b | 5c 66 50 28 29 20 72 65 |in_check|\fP() re|
|000038f0| 74 75 72 6e 73 20 7a 65 | 72 6f 20 77 68 65 6e 20 |turns ze|ro when |
|00003900| 74 68 65 72 65 20 61 72 | 65 20 6e 6f 0a 58 70 72 |there ar|e no.Xpr|
|00003910| 6f 62 6c 65 6d 73 20 66 | 6f 75 6e 64 20 69 6e 20 |oblems f|ound in |
|00003920| 74 68 65 20 6d 61 6c 6c | 6f 63 20 63 68 61 69 6e |the mall|oc chain|
|00003930| 2c 20 6e 6f 6e 2d 7a 65 | 72 6f 20 6f 74 68 65 72 |, non-ze|ro other|
|00003940| 77 69 73 65 2e 0a 58 2e | 50 0a 58 2e 6e 65 20 35 |wise..X.|P.X.ne 5|
|00003950| 0a 58 5c 66 42 6d 61 6c | 6c 6f 63 5f 64 75 6d 70 |.X\fBmal|loc_dump|
|00003960| 5c 66 50 28 29 20 77 69 | 6c 6c 20 64 75 6d 70 20 |\fP() wi|ll dump |
|00003970| 61 20 6c 69 73 74 20 6f | 66 20 61 6c 6c 20 69 6e |a list o|f all in|
|00003980| 2d 75 73 65 20 6d 61 6c | 6c 6f 63 20 73 65 67 6d |-use mal|loc segm|
|00003990| 65 6e 74 73 20 0a 58 61 | 6e 64 20 74 68 65 20 66 |ents .Xa|nd the f|
|000039a0| 69 72 73 74 20 66 65 77 | 20 62 79 74 65 73 20 6f |irst few| bytes o|
|000039b0| 66 20 65 61 63 68 20 73 | 65 67 6d 65 6e 74 2e 20 |f each s|egment. |
|000039c0| 20 49 66 20 74 68 65 20 | 65 6e 76 69 72 6f 6e 6d | If the |environm|
|000039d0| 65 6e 74 20 76 61 72 69 | 61 62 6c 65 0a 58 5c 73 |ent vari|able.X\s|
|000039e0| 2d 31 4d 41 4c 4c 4f 43 | 5f 44 45 54 41 49 4c 5c |-1MALLOC|_DETAIL\|
|000039f0| 73 2b 31 20 69 73 20 73 | 65 74 20 74 6f 20 61 20 |s+1 is s|et to a |
|00003a00| 6e 6f 6e 2d 7a 65 72 6f | 20 69 6e 74 65 67 65 72 |non-zero| integer|
|00003a10| 2c 20 61 6c 6c 20 73 65 | 67 6d 65 6e 74 73 20 28 |, all se|gments (|
|00003a20| 69 6e 63 6c 75 64 69 6e | 67 0a 58 74 68 6f 73 65 |includin|g.Xthose|
|00003a30| 20 74 68 61 74 20 68 61 | 76 65 20 62 65 65 6e 20 | that ha|ve been |
|00003a40| 66 72 65 65 64 29 20 61 | 72 65 20 6c 69 73 74 65 |freed) a|re liste|
|00003a50| 64 20 61 6e 64 20 61 64 | 64 69 74 69 6f 6e 61 6c |d and ad|ditional|
|00003a60| 20 69 6e 74 65 72 6e 61 | 6c 20 69 6e 66 6f 72 6d | interna|l inform|
|00003a70| 61 74 69 6f 6e 0a 58 69 | 73 20 64 69 73 70 6c 61 |ation.Xi|s displa|
|00003a80| 79 65 64 2e 20 20 5c 66 | 42 66 64 5c 66 50 20 69 |yed. \f|Bfd\fP i|
|00003a90| 73 20 74 68 65 20 66 69 | 6c 65 20 64 65 73 63 72 |s the fi|le descr|
|00003aa0| 69 70 74 6f 72 20 74 6f | 20 77 72 69 74 65 20 74 |iptor to| write t|
|00003ab0| 68 65 20 64 61 74 61 20 | 74 6f 2e 0a 58 2e 50 0a |he data |to..X.P.|
|00003ac0| 58 2e 6e 65 20 36 0a 58 | 5c 66 42 6d 61 6c 6c 6f |X.ne 6.X|\fBmallo|
|00003ad0| 63 5f 6c 69 73 74 5c 66 | 50 28 29 20 77 69 6c 6c |c_list\f|P() will|
|00003ae0| 20 64 75 6d 70 20 61 20 | 6c 69 73 74 20 69 6e 20 | dump a |list in |
|00003af0| 74 68 65 20 73 61 6d 65 | 20 66 6f 72 6d 61 74 20 |the same| format |
|00003b00| 61 73 20 5c 66 42 6d 61 | 6c 6c 6f 63 5f 64 75 6d |as \fBma|lloc_dum|
|00003b10| 70 5c 66 50 20 62 75 74 | 0a 58 6f 6e 6c 79 20 74 |p\fP but|.Xonly t|
|00003b20| 68 65 20 69 74 65 6d 73 | 20 74 68 61 74 20 61 72 |he items| that ar|
|00003b30| 65 20 73 74 69 6c 6c 20 | 69 6e 20 75 73 65 20 61 |e still |in use a|
|00003b40| 6e 64 20 77 68 69 63 68 | 20 68 61 76 65 20 62 65 |nd which| have be|
|00003b50| 65 6e 20 61 6c 6c 6f 63 | 61 74 65 64 20 77 69 74 |en alloc|ated wit|
|00003b60| 68 69 6e 0a 58 74 68 65 | 20 6d 61 6c 6c 6f 63 20 |hin.Xthe| malloc |
|00003b70| 68 69 73 74 6f 72 79 20 | 69 64 20 72 61 6e 67 65 |history |id range|
|00003b80| 20 73 70 65 63 69 66 69 | 65 64 20 62 79 20 5c 66 | specifi|ed by \f|
|00003b90| 42 68 69 73 74 69 64 31 | 5c 66 50 20 61 6e 64 0a |Bhistid1|\fP and.|
|00003ba0| 58 5c 66 42 68 69 73 74 | 69 64 32 5c 66 50 2c 20 |X\fBhist|id2\fP, |
|00003bb0| 69 6e 63 6c 75 73 69 76 | 65 2e 20 20 54 68 65 20 |inclusiv|e. The |
|00003bc0| 5c 66 42 68 69 73 74 69 | 64 5c 66 50 73 20 61 72 |\fBhisti|d\fPs ar|
|00003bd0| 65 20 6f 62 74 61 69 6e | 65 64 20 66 72 6f 6d 20 |e obtain|ed from |
|00003be0| 63 61 6c 6c 73 0a 58 74 | 6f 20 5c 66 42 6d 61 6c |calls.Xt|o \fBmal|
|00003bf0| 6c 6f 63 5f 69 6e 75 73 | 65 5c 66 50 28 29 2e 20 |loc_inus|e\fP(). |
|00003c00| 54 68 69 73 20 69 73 20 | 65 73 70 65 63 69 61 6c |This is |especial|
|00003c10| 6c 79 20 75 73 65 66 75 | 6c 20 69 6e 20 74 72 61 |ly usefu|l in tra|
|00003c20| 63 6b 69 6e 67 20 64 6f | 77 6e 20 6d 65 6d 6f 72 |cking do|wn memor|
|00003c30| 79 0a 58 6c 65 61 6b 73 | 2e 20 20 5c 66 42 66 64 |y.Xleaks|. \fBfd|
|00003c40| 5c 66 50 20 69 73 20 74 | 68 65 20 66 69 6c 65 20 |\fP is t|he file |
|00003c50| 64 65 73 63 72 69 70 74 | 6f 72 20 74 6f 20 77 72 |descript|or to wr|
|00003c60| 69 74 65 20 74 68 65 20 | 64 61 74 61 20 74 6f 2e |ite the |data to.|
|00003c70| 0a 58 2e 50 0a 58 2e 6e | 65 20 36 0a 58 5c 66 42 |.X.P.X.n|e 6.X\fB|
|00003c80| 6d 61 6c 6c 6f 63 5f 69 | 6e 75 73 65 5c 66 50 28 |malloc_i|nuse\fP(|
|00003c90| 29 20 72 65 74 75 72 6e | 73 20 74 68 65 20 61 6d |) return|s the am|
|00003ca0| 6f 75 6e 74 20 6f 66 20 | 6d 61 6c 6c 6f 63 20 64 |ount of |malloc d|
|00003cb0| 61 74 61 20 74 68 61 74 | 20 69 73 20 63 75 72 72 |ata that| is curr|
|00003cc0| 65 6e 74 6c 79 0a 58 69 | 6e 20 75 73 65 20 28 69 |ently.Xi|n use (i|
|00003cd0| 6e 20 62 79 74 65 73 29 | 2e 20 20 49 66 20 5c 66 |n bytes)|. If \f|
|00003ce0| 42 68 69 73 74 69 64 70 | 74 72 5c 66 50 20 69 73 |Bhistidp|tr\fP is|
|00003cf0| 20 6e 6f 74 20 4e 55 4c | 4c 2c 20 69 74 20 69 73 | not NUL|L, it is|
|00003d00| 20 74 61 6b 65 6e 20 74 | 6f 20 62 65 20 61 20 70 | taken t|o be a p|
|00003d10| 6f 69 6e 74 65 72 0a 58 | 74 6f 20 61 20 70 6c 61 |ointer.X|to a pla|
|00003d20| 63 65 20 74 6f 20 73 74 | 6f 72 65 20 74 68 65 20 |ce to st|ore the |
|00003d30| 63 75 72 72 65 6e 74 20 | 6d 61 6c 6c 6f 63 20 68 |current |malloc h|
|00003d40| 69 73 74 6f 72 79 20 69 | 64 20 77 68 69 63 68 20 |istory i|d which |
|00003d50| 63 61 6e 20 62 65 20 75 | 73 65 64 20 6c 61 74 65 |can be u|sed late|
|00003d60| 72 0a 58 77 68 65 6e 20 | 5c 66 42 6d 61 6c 6c 6f |r.Xwhen |\fBmallo|
|00003d70| 63 5f 6c 69 73 74 5c 66 | 50 20 69 73 20 63 61 6c |c_list\f|P is cal|
|00003d80| 6c 65 64 20 74 6f 20 6c | 69 73 74 20 69 74 65 6d |led to l|ist item|
|00003d90| 73 20 74 68 61 74 20 61 | 72 65 20 73 74 69 6c 6c |s that a|re still|
|00003da0| 20 69 6e 20 75 73 65 2e | 0a 58 2e 50 0a 58 2e 6e | in use.|.X.P.X.n|
|00003db0| 65 20 31 30 0a 58 54 68 | 65 20 66 6f 6c 6c 6f 77 |e 10.XTh|e follow|
|00003dc0| 69 6e 67 20 65 78 61 6d | 70 6c 65 20 73 68 6f 77 |ing exam|ple show|
|00003dd0| 73 20 74 68 65 20 74 79 | 70 69 63 61 6c 20 75 73 |s the ty|pical us|
|00003de0| 65 20 6f 66 20 74 68 65 | 20 5c 66 42 6d 61 6c 6c |e of the| \fBmall|
|00003df0| 6f 63 5f 69 6e 75 73 65 | 5c 66 50 20 61 6e 64 0a |oc_inuse|\fP and.|
|00003e00| 58 5c 66 42 6d 61 6c 6c | 6f 63 5f 6c 69 73 74 5c |X\fBmall|oc_list\|
|00003e10| 66 50 20 66 75 6e 63 74 | 69 6f 6e 73 20 69 6e 20 |fP funct|ions in |
|00003e20| 74 72 61 63 6b 69 6e 67 | 20 64 6f 77 6e 20 6d 65 |tracking| down me|
|00003e30| 6d 6f 72 79 20 6c 65 61 | 6b 73 3a 0a 58 2e 65 58 |mory lea|ks:.X.eX|
|00003e40| 0a 58 75 6e 73 69 67 6e | 65 64 20 6c 6f 6e 67 09 |.Xunsign|ed long.|
|00003e50| 68 69 73 74 69 64 31 2c | 20 68 69 73 74 69 64 32 |histid1,| histid2|
|00003e60| 2c 20 6f 72 69 67 5f 73 | 69 7a 65 2c 20 63 75 72 |, orig_s|ize, cur|
|00003e70| 72 65 6e 74 5f 73 69 7a | 65 3b 0a 58 0a 58 6f 72 |rent_siz|e;.X.Xor|
|00003e80| 69 67 5f 73 69 7a 65 20 | 3d 20 6d 61 6c 6c 6f 63 |ig_size |= malloc|
|00003e90| 5f 69 6e 75 73 65 28 26 | 68 69 73 74 69 64 31 29 |_inuse(&|histid1)|
|00003ea0| 3b 0a 58 0a 58 2f 2a 20 | 2e 2e 2e 2e 2e 20 67 6f |;.X.X/* |..... go|
|00003eb0| 20 64 6f 20 6c 6f 74 73 | 20 6f 66 20 73 74 75 66 | do lots| of stuf|
|00003ec0| 66 20 2e 2e 2e 2e 2e 2e | 20 2a 2f 0a 58 0a 58 63 |f ......| */.X.Xc|
|00003ed0| 75 72 72 65 6e 74 5f 73 | 69 7a 65 20 3d 20 6d 61 |urrent_s|ize = ma|
|00003ee0| 6c 6c 6f 63 5f 69 6e 75 | 73 65 28 26 68 69 73 74 |lloc_inu|se(&hist|
|00003ef0| 69 64 32 29 3b 0a 58 0a | 58 69 66 28 20 63 75 72 |id2);.X.|Xif( cur|
|00003f00| 72 65 6e 74 5f 73 69 7a | 65 20 21 3d 20 6f 72 69 |rent_siz|e != ori|
|00003f10| 67 5f 73 69 7a 65 20 29 | 0a 58 7b 0a 58 09 6d 61 |g_size )|.X{.X.ma|
|00003f20| 6c 6c 6f 63 5f 6c 69 73 | 74 28 32 2c 68 69 73 74 |lloc_lis|t(2,hist|
|00003f30| 69 64 31 2c 68 69 73 74 | 69 64 32 29 3b 0a 58 7d |id1,hist|id2);.X}|
|00003f40| 0a 58 2e 65 58 0a 58 5c | 66 42 6d 61 6c 6c 6f 63 |.X.eX.X\|fBmalloc|
|00003f50| 5f 6d 61 72 6b 5c 66 50 | 28 29 20 6d 61 72 6b 73 |_mark\fP|() marks|
|00003f60| 20 61 20 73 65 67 6d 65 | 6e 74 20 61 73 20 61 20 | a segme|nt as a |
|00003f70| 6e 6f 6e 2d 6c 65 61 6b | 2e 20 20 53 65 67 6d 65 |non-leak|. Segme|
|00003f80| 6e 74 73 20 74 68 61 74 | 20 61 72 65 20 6d 61 72 |nts that| are mar|
|00003f90| 6b 65 64 0a 58 61 72 65 | 20 6e 6f 74 20 63 6f 75 |ked.Xare| not cou|
|00003fa0| 6e 74 65 64 20 6f 72 20 | 6c 69 73 74 65 64 20 77 |nted or |listed w|
|00003fb0| 68 65 6e 20 64 65 61 6c | 69 6e 67 20 77 69 74 68 |hen deal|ing with|
|00003fc0| 20 6d 65 6d 6f 72 79 20 | 6c 65 61 6b 73 2e 20 20 | memory |leaks. |
|00003fd0| 54 68 69 73 20 69 73 20 | 64 65 73 69 67 6e 65 64 |This is |designed|
|00003fe0| 0a 58 74 6f 20 62 65 20 | 75 73 65 64 20 6f 6e 20 |.Xto be |used on |
|00003ff0| 70 6f 69 6e 74 65 72 73 | 20 74 68 61 74 20 72 65 |pointers| that re|
|00004000| 6d 61 69 6e 20 61 72 6f | 75 6e 64 20 66 6f 72 65 |main aro|und fore|
|00004010| 76 65 72 20 61 6e 64 20 | 73 68 6f 75 6c 64 6e 27 |ver and |shouldn'|
|00004020| 74 20 62 65 20 63 6f 6e | 73 69 64 65 72 65 64 0a |t be con|sidered.|
|00004030| 58 74 6f 20 62 65 20 61 | 20 6c 65 61 6b 20 28 69 |Xto be a| leak (i|
|00004040| 6e 20 6f 72 64 65 72 20 | 74 6f 20 64 65 63 72 65 |n order |to decre|
|00004050| 61 73 65 20 74 68 65 20 | 61 6d 6f 75 6e 74 20 6f |ase the |amount o|
|00004060| 66 20 65 6e 74 72 69 65 | 73 20 69 6e 20 74 68 65 |f entrie|s in the|
|00004070| 20 6c 65 61 6b 20 6c 69 | 73 74 73 29 0a 58 2e 50 | leak li|sts).X.P|
|00004080| 0a 58 5c 66 42 6d 61 6c | 6c 6f 63 5f 61 62 6f 72 |.X\fBmal|loc_abor|
|00004090| 74 5c 66 50 28 29 20 63 | 61 75 73 65 73 20 74 68 |t\fP() c|auses th|
|000040a0| 65 20 63 75 72 72 65 6e | 74 20 70 72 6f 67 72 61 |e curren|t progra|
|000040b0| 6d 20 74 6f 20 64 72 6f | 70 20 63 6f 72 65 20 61 |m to dro|p core a|
|000040c0| 6e 64 20 65 78 69 74 2e | 20 20 54 68 69 73 0a 58 |nd exit.| This.X|
|000040d0| 66 75 6e 63 74 69 6f 6e | 20 73 69 6d 70 6c 79 20 |function| simply |
|000040e0| 63 61 6c 6c 73 20 5c 66 | 42 61 62 6f 72 74 5c 66 |calls \f|Babort\f|
|000040f0| 50 28 29 20 74 6f 20 64 | 6f 20 69 74 73 20 64 69 |P() to d|o its di|
|00004100| 72 74 79 20 77 6f 72 6b | 20 61 6e 64 20 69 73 20 |rty work| and is |
|00004110| 68 65 72 65 20 73 6f 6c | 65 6c 79 20 0a 58 66 6f |here sol|ely .Xfo|
|00004120| 72 20 74 68 65 20 70 75 | 72 70 6f 73 65 20 6f 66 |r the pu|rpose of|
|00004130| 20 61 6c 6c 6f 77 69 6e | 67 20 74 68 65 20 70 72 | allowin|g the pr|
|00004140| 6f 67 72 61 6d 6d 65 72 | 20 74 6f 20 73 75 62 73 |ogrammer| to subs|
|00004150| 74 69 74 75 74 65 20 74 | 68 69 65 72 20 6f 77 6e |titute t|hier own|
|00004160| 20 61 62 6f 72 74 0a 58 | 72 6f 75 74 69 6e 65 20 | abort.X|routine |
|00004170| 74 6f 20 68 61 6e 64 6c | 65 20 66 61 74 61 6c 20 |to handl|e fatal |
|00004180| 65 72 72 6f 72 73 2e 20 | 20 49 66 20 61 20 73 75 |errors. | If a su|
|00004190| 62 73 74 69 74 75 74 65 | 20 72 6f 75 74 69 6e 65 |bstitute| routine|
|000041a0| 20 69 73 20 75 73 65 64 | 2c 20 69 74 20 6d 75 73 | is used|, it mus|
|000041b0| 74 20 6e 6f 74 0a 58 72 | 65 74 75 72 6e 20 74 6f |t not.Xr|eturn to|
|000041c0| 20 74 68 65 20 63 61 6c | 6c 65 72 20 6f 72 20 65 | the cal|ler or e|
|000041d0| 6c 73 65 20 74 68 65 20 | 70 72 6f 67 72 61 6d 20 |lse the |program |
|000041e0| 77 69 6c 6c 20 75 73 65 | 20 74 68 65 20 5c 66 42 |will use| the \fB|
|000041f0| 61 62 6f 72 74 5c 66 50 | 28 29 20 73 79 73 74 65 |abort\fP|() syste|
|00004200| 6d 0a 58 63 61 6c 6c 20 | 74 6f 20 63 61 75 73 65 |m.Xcall |to cause|
|00004210| 20 74 68 65 20 70 72 6f | 67 72 61 6d 20 74 6f 20 | the pro|gram to |
|00004220| 73 74 6f 70 2e 0a 58 2e | 50 0a 58 5c 66 42 6d 61 |stop..X.|P.X\fBma|
|00004230| 6c 6c 6f 63 5f 65 6e 74 | 65 72 5c 66 50 28 29 20 |lloc_ent|er\fP() |
|00004240| 61 6e 64 20 5c 66 42 6d | 61 6c 6c 6f 63 5f 6c 65 |and \fBm|alloc_le|
|00004250| 61 76 65 5c 66 50 28 29 | 20 70 72 6f 76 69 64 65 |ave\fP()| provide|
|00004260| 20 61 20 72 75 64 69 6d | 65 6e 74 61 72 79 20 6d | a rudim|entary m|
|00004270| 65 63 68 61 6e 69 73 6d | 0a 58 74 6f 20 74 72 61 |echanism|.Xto tra|
|00004280| 63 6b 20 74 68 65 20 63 | 61 6c 6c 69 6e 67 20 73 |ck the c|alling s|
|00004290| 74 61 63 6b 20 74 68 61 | 74 20 77 61 73 20 69 6e |tack tha|t was in|
|000042a0| 20 70 6c 61 63 65 20 77 | 68 65 6e 20 74 68 65 20 | place w|hen the |
|000042b0| 61 6c 6c 6f 63 61 74 69 | 6f 6e 20 77 61 73 20 6d |allocati|on was m|
|000042c0| 61 64 65 2e 0a 58 49 6e | 20 6f 72 64 65 72 20 74 |ade..XIn| order t|
|000042d0| 6f 20 75 73 65 20 74 68 | 69 73 20 66 65 61 74 75 |o use th|is featu|
|000042e0| 72 65 2c 20 74 68 65 20 | 65 6e 74 65 72 20 66 75 |re, the |enter fu|
|000042f0| 6e 63 74 69 6f 6e 20 73 | 68 6f 75 6c 64 20 62 65 |nction s|hould be|
|00004300| 20 63 61 6c 6c 65 64 20 | 75 70 6f 6e 0a 58 65 6e | called |upon.Xen|
|00004310| 74 72 79 20 74 6f 20 61 | 20 66 75 6e 63 74 69 6f |try to a| functio|
|00004320| 6e 2c 20 77 68 69 6c 65 | 20 74 68 65 20 6c 65 61 |n, while| the lea|
|00004330| 76 65 20 66 75 6e 63 74 | 69 6f 6e 20 69 73 20 63 |ve funct|ion is c|
|00004340| 61 6c 6c 65 64 20 77 68 | 65 6e 20 79 6f 75 20 65 |alled wh|en you e|
|00004350| 78 69 74 0a 58 66 72 6f | 6d 20 74 68 65 20 66 75 |xit.Xfro|m the fu|
|00004360| 6e 63 74 69 6f 6e 2e 20 | 20 49 6e 20 6f 72 64 65 |nction. | In orde|
|00004370| 72 20 74 6f 20 62 65 20 | 61 63 63 75 72 61 74 65 |r to be |accurate|
|00004380| 2c 20 74 68 65 20 74 77 | 6f 20 66 75 6e 63 74 69 |, the tw|o functi|
|00004390| 6f 6e 73 20 6d 75 73 74 | 20 62 65 20 0a 58 75 73 |ons must| be .Xus|
|000043a0| 65 64 20 69 6e 20 63 6f | 6e 6a 75 6e 63 74 69 6f |ed in co|njunctio|
|000043b0| 6e 20 77 69 74 68 20 65 | 61 63 68 20 6f 74 68 65 |n with e|ach othe|
|000043c0| 72 20 61 6e 64 20 61 20 | 6d 69 73 73 69 6e 67 20 |r and a |missing |
|000043d0| 63 61 6c 6c 20 77 69 6c | 6c 20 72 65 73 75 6c 74 |call wil|l result|
|000043e0| 20 69 6e 0a 58 61 6e 20 | 65 72 72 6f 72 20 67 65 | in.Xan |error ge|
|000043f0| 6e 65 72 61 74 65 64 20 | 62 79 20 74 68 65 20 6c |nerated |by the l|
|00004400| 69 62 72 61 72 79 20 28 | 69 66 20 69 74 20 69 73 |ibrary (|if it is|
|00004410| 20 64 65 74 65 63 74 65 | 64 29 2e 0a 58 2e 50 0a | detecte|d)..X.P.|
|00004420| 58 4e 4f 54 45 3a 20 74 | 68 65 20 61 72 67 75 6d |XNOTE: t|he argum|
|00004430| 65 6e 74 20 74 6f 20 65 | 69 74 68 65 72 20 6f 66 |ent to e|ither of|
|00004440| 20 74 68 65 73 65 20 66 | 75 6e 63 74 69 6f 6e 73 | these f|unctions|
|00004450| 20 5c 66 42 6d 75 73 74 | 5c 66 50 20 62 65 20 61 | \fBmust|\fP be a|
|00004460| 20 63 6f 6e 73 74 61 6e | 74 0a 58 63 68 61 72 61 | constan|t.Xchara|
|00004470| 63 74 65 72 20 73 74 72 | 69 6e 67 20 6f 72 20 61 |cter str|ing or a|
|00004480| 20 73 74 61 74 69 63 20 | 64 61 74 61 20 61 72 65 | static |data are|
|00004490| 61 2e 20 20 54 68 69 73 | 20 69 73 20 62 65 63 61 |a. This| is beca|
|000044a0| 75 73 65 20 74 68 65 20 | 73 74 61 63 6b 20 6d 65 |use the |stack me|
|000044b0| 63 68 61 6e 69 73 6d 0a | 58 64 6f 65 73 20 6e 6f |chanism.|Xdoes no|
|000044c0| 74 20 6d 61 69 6e 74 61 | 69 6e 20 69 74 27 73 20 |t mainta|in it's |
|000044d0| 6f 77 6e 20 63 6f 70 79 | 20 6f 66 20 74 68 65 73 |own copy| of thes|
|000044e0| 65 20 73 74 72 69 6e 67 | 73 2c 20 69 74 20 6a 75 |e string|s, it ju|
|000044f0| 73 74 20 72 65 63 6f 72 | 64 73 20 70 6f 69 6e 74 |st recor|ds point|
|00004500| 65 72 73 0a 58 74 6f 20 | 74 68 65 20 73 74 72 69 |ers.Xto |the stri|
|00004510| 6e 67 73 20 61 6e 64 20 | 69 66 20 74 68 65 20 73 |ngs and |if the s|
|00004520| 74 72 69 6e 67 73 20 61 | 72 65 20 6f 6e 20 74 68 |trings a|re on th|
|00004530| 65 20 73 74 61 63 6b 2c | 20 74 68 65 79 20 77 69 |e stack,| they wi|
|00004540| 6c 6c 20 67 6f 20 61 77 | 61 79 2e 0a 58 54 79 70 |ll go aw|ay..XTyp|
|00004550| 69 63 61 6c 6c 79 20 74 | 68 65 20 66 75 6e 63 74 |ically t|he funct|
|00004560| 69 6f 6e 73 20 77 6f 75 | 6c 64 20 62 65 20 75 73 |ions wou|ld be us|
|00004570| 65 64 20 77 69 74 68 20 | 22 66 75 6e 63 6e 61 6d |ed with |"funcnam|
|00004580| 65 22 20 61 73 20 74 68 | 65 20 61 72 67 75 6d 65 |e" as th|e argume|
|00004590| 6e 74 20 61 6e 64 0a 58 | 74 68 69 73 20 77 69 6c |nt and.X|this wil|
|000045a0| 6c 20 61 76 6f 69 64 20 | 61 6e 79 20 70 72 6f 62 |l avoid |any prob|
|000045b0| 6c 65 6d 73 2e 0a 58 2e | 50 0a 58 54 68 65 20 73 |lems..X.|P.XThe s|
|000045c0| 74 61 63 6b 20 69 73 20 | 6c 69 73 74 65 64 20 6f |tack is |listed o|
|000045d0| 6e 20 74 68 65 20 64 75 | 6d 70 20 61 6e 64 2f 6f |n the du|mp and/o|
|000045e0| 72 20 6c 69 73 74 20 72 | 65 70 6f 72 74 73 20 61 |r list r|eports a|
|000045f0| 6e 64 20 6f 6e 20 61 6e | 20 65 72 72 6f 72 20 0a |nd on an| error .|
|00004600| 58 6d 65 73 73 61 67 65 | 20 66 6f 72 20 61 20 73 |Xmessage| for a s|
|00004610| 65 67 6d 65 6e 74 20 74 | 68 61 74 20 68 61 73 20 |egment t|hat has |
|00004620| 61 6c 72 65 61 64 79 20 | 62 65 65 6e 20 66 72 65 |already |been fre|
|00004630| 65 64 2e 0a 58 2e 50 0a | 58 49 66 20 74 68 65 73 |ed..X.P.|XIf thes|
|00004640| 65 20 66 75 6e 63 74 69 | 6f 6e 73 20 68 61 76 65 |e functi|ons have|
|00004650| 20 62 65 65 6e 20 75 73 | 65 64 2c 20 65 72 72 6f | been us|ed, erro|
|00004660| 72 20 6d 65 73 73 61 67 | 65 73 20 77 69 6c 6c 20 |r messag|es will |
|00004670| 69 6e 63 6c 75 64 65 0a | 58 74 68 65 20 73 74 61 |include.|Xthe sta|
|00004680| 63 6b 20 69 6e 66 6f 72 | 6d 61 74 69 6f 6e 20 77 |ck infor|mation w|
|00004690| 68 65 6e 20 74 68 65 20 | 69 64 65 6e 74 69 74 79 |hen the |identity|
|000046a0| 20 6f 66 20 74 68 65 20 | 65 72 72 6f 72 20 69 73 | of the |error is|
|000046b0| 20 0a 58 64 69 73 70 6c | 61 79 65 64 2e 20 20 46 | .Xdispl|ayed. F|
|000046c0| 6f 72 20 65 78 61 6d 70 | 6c 65 3a 0a 58 2e 65 58 |or examp|le:.X.eX|
|000046d0| 0a 58 54 68 69 73 20 65 | 72 72 6f 72 20 69 73 20 |.XThis e|rror is |
|000046e0| 2a 70 72 6f 62 61 62 6c | 79 2a 20 61 73 73 6f 63 |*probabl|y* assoc|
|000046f0| 69 61 74 65 64 20 77 69 | 74 68 20 74 68 65 20 66 |iated wi|th the f|
|00004700| 6f 6c 6c 6f 77 69 6e 67 | 20 61 6c 6c 6f 63 61 74 |ollowing| allocat|
|00004710| 69 6f 6e 3a 0a 58 0a 58 | 20 20 20 20 41 20 63 61 |ion:.X.X| A ca|
|00004720| 6c 6c 20 74 6f 20 6d 61 | 6c 6c 6f 63 20 66 6f 72 |ll to ma|lloc for|
|00004730| 20 31 20 62 79 74 65 73 | 20 69 6e 20 74 65 73 74 | 1 bytes| in test|
|00004740| 73 74 61 63 6b 2e 63 20 | 6f 6e 20 6c 69 6e 65 20 |stack.c |on line |
|00004750| 37 35 2e 0a 58 20 20 20 | 20 54 68 69 73 20 77 61 |75..X | This wa|
|00004760| 73 20 74 68 65 20 31 33 | 74 68 20 63 61 6c 6c 20 |s the 13|th call |
|00004770| 74 6f 20 6d 61 6c 6c 6f | 63 2e 0a 58 20 20 20 20 |to mallo|c..X |
|00004780| 53 74 61 63 6b 20 66 72 | 6f 6d 20 77 68 65 72 65 |Stack fr|om where|
|00004790| 20 61 6c 6c 6f 63 61 74 | 65 64 3a 0a 58 20 20 20 | allocat|ed:.X |
|000047a0| 20 20 2d 3e 20 73 75 62 | 33 28 29 20 69 6e 20 74 | -> sub|3() in t|
|000047b0| 65 73 74 73 74 61 63 6b | 2e 63 28 37 33 29 0a 58 |eststack|.c(73).X|
|000047c0| 20 20 20 20 20 2d 3e 20 | 73 75 62 32 28 29 20 69 | -> |sub2() i|
|000047d0| 6e 20 74 65 73 74 73 74 | 61 63 6b 2e 63 28 35 39 |n testst|ack.c(59|
|000047e0| 29 0a 58 20 20 20 20 20 | 2d 3e 20 6d 61 69 6e 28 |).X |-> main(|
|000047f0| 29 20 69 6e 20 74 65 73 | 74 73 74 61 63 6b 2e 63 |) in tes|tstack.c|
|00004800| 28 32 33 29 0a 58 0a 58 | 2e 65 58 0a 58 2e 62 72 |(23).X.X|.eX.X.br|
|00004810| 0a 58 2e 62 72 0a 58 2e | 6e 65 20 32 30 0a 58 2e |.X.br.X.|ne 20.X.|
|00004820| 53 48 20 22 55 53 41 47 | 45 22 0a 58 54 68 65 20 |SH "USAG|E".XThe |
|00004830| 6c 69 62 72 61 72 79 20 | 63 61 6e 20 62 65 20 75 |library |can be u|
|00004840| 73 65 64 20 69 6e 20 73 | 65 76 65 72 61 6c 20 6d |sed in s|everal m|
|00004850| 6f 64 65 73 2c 20 65 61 | 63 68 20 69 6e 63 72 65 |odes, ea|ch incre|
|00004860| 61 73 69 6e 67 6c 79 20 | 69 6e 74 72 75 73 69 76 |asingly |intrusiv|
|00004870| 65 20 28 69 2e 65 2e 20 | 0a 58 72 65 71 75 69 72 |e (i.e. |.Xrequir|
|00004880| 69 6e 67 20 63 68 61 6e | 67 65 73 20 74 6f 20 62 |ing chan|ges to b|
|00004890| 65 20 6d 61 64 65 20 74 | 6f 20 74 68 65 20 62 75 |e made t|o the bu|
|000048a0| 69 6c 64 20 70 72 6f 63 | 65 73 73 20 61 6e 64 2f |ild proc|ess and/|
|000048b0| 6f 72 20 73 6f 75 72 63 | 65 20 63 6f 64 65 29 2e |or sourc|e code).|
|000048c0| 20 20 48 6f 77 65 76 65 | 72 2c 0a 58 74 68 65 20 | Howeve|r,.Xthe |
|000048d0| 65 78 74 72 61 20 63 6f | 73 74 20 6f 66 20 61 20 |extra co|st of a |
|000048e0| 6c 69 74 74 6c 65 20 69 | 6e 74 72 75 73 69 76 65 |little i|ntrusive|
|000048f0| 6e 65 73 73 20 69 73 20 | 72 65 70 61 69 64 20 69 |ness is |repaid i|
|00004900| 6e 20 6d 75 63 68 20 62 | 65 74 74 65 72 20 70 72 |n much b|etter pr|
|00004910| 6f 62 6c 65 6d 0a 58 69 | 64 65 6e 74 69 66 69 63 |oblem.Xi|dentific|
|00004920| 61 74 69 6f 6e 2e 20 20 | 45 61 63 68 20 6d 6f 64 |ation. |Each mod|
|00004930| 65 20 69 73 20 62 75 69 | 6c 74 20 75 70 6f 6e 20 |e is bui|lt upon |
|00004940| 74 68 65 20 70 72 65 76 | 69 6f 75 73 20 6d 6f 64 |the prev|ious mod|
|00004950| 65 73 20 61 6e 64 20 74 | 68 65 72 65 66 6f 72 65 |es and t|herefore|
|00004960| 0a 58 72 65 71 75 69 72 | 65 73 20 74 68 65 20 63 |.Xrequir|es the c|
|00004970| 68 61 6e 67 65 73 20 61 | 6e 64 2f 6f 72 20 63 6f |hanges a|nd/or co|
|00004980| 6d 6d 61 6e 64 73 20 73 | 70 65 63 69 66 69 65 64 |mmands s|pecified|
|00004990| 20 69 6e 20 74 68 65 20 | 6c 6f 77 65 72 20 6d 6f | in the |lower mo|
|000049a0| 64 65 73 2e 0a 58 2e 50 | 0a 58 2e 6e 65 20 31 30 |des..X.P|.X.ne 10|
|000049b0| 0a 58 5c 66 42 4d 4f 44 | 45 20 31 20 2d 20 6c 69 |.X\fBMOD|E 1 - li|
|000049c0| 62 72 61 72 79 20 73 75 | 62 73 74 69 74 75 74 69 |brary su|bstituti|
|000049d0| 6f 6e 5c 66 50 0a 58 2e | 50 0a 58 54 68 65 20 73 |on\fP.X.|P.XThe s|
|000049e0| 69 6d 70 6c 65 73 74 20 | 75 73 65 20 69 73 20 74 |implest |use is t|
|000049f0| 6f 20 6a 75 73 74 20 6c | 69 6e 6b 20 74 68 65 20 |o just l|ink the |
|00004a00| 6f 62 6a 65 63 74 20 6d | 6f 64 75 6c 65 20 77 69 |object m|odule wi|
|00004a10| 74 68 20 74 68 65 20 5c | 66 42 6c 69 62 64 62 6d |th the \|fBlibdbm|
|00004a20| 61 6c 6c 6f 63 2e 61 5c | 66 50 2e 0a 58 42 65 20 |alloc.a\|fP..XBe |
|00004a30| 73 75 72 65 20 74 6f 20 | 68 61 76 65 20 74 68 69 |sure to |have thi|
|00004a40| 73 20 6c 69 62 72 61 72 | 79 20 62 65 66 6f 72 65 |s librar|y before|
|00004a50| 20 74 68 65 20 43 20 6c | 69 62 72 61 72 79 20 28 | the C l|ibrary (|
|00004a60| 5c 66 42 6c 69 62 63 2e | 61 5c 66 50 29 20 6f 6e |\fBlibc.|a\fP) on|
|00004a70| 20 74 68 65 0a 58 6c 69 | 6e 6b 20 63 6f 6d 6d 61 | the.Xli|nk comma|
|00004a80| 6e 64 20 28 74 68 69 73 | 20 69 73 20 61 75 74 6f |nd (this| is auto|
|00004a90| 6d 61 74 69 63 20 69 66 | 20 79 6f 75 20 75 73 65 |matic if| you use|
|00004aa0| 20 5c 66 42 63 63 5c 66 | 50 20 74 6f 20 6c 69 6e | \fBcc\f|P to lin|
|00004ab0| 6b 20 61 6e 64 20 73 70 | 65 63 69 66 79 20 74 68 |k and sp|ecify th|
|00004ac0| 65 20 0a 58 64 65 62 75 | 67 20 6c 69 62 72 61 72 |e .Xdebu|g librar|
|00004ad0| 79 20 77 69 74 68 6f 75 | 74 20 73 70 65 63 69 66 |y withou|t specif|
|00004ae0| 79 69 6e 67 20 74 68 65 | 20 43 20 6c 69 62 72 61 |ying the| C libra|
|00004af0| 72 79 29 2e 0a 58 2e 50 | 0a 58 54 68 69 73 20 6d |ry)..X.P|.XThis m|
|00004b00| 6f 64 65 20 6c 69 6e 6b | 73 20 69 6e 20 61 6c 6c |ode link|s in all|
|00004b10| 20 6f 66 20 74 68 65 20 | 64 65 62 75 67 20 76 65 | of the |debug ve|
|00004b20| 72 73 69 6f 6e 73 20 6f | 66 20 74 68 65 20 6c 69 |rsions o|f the li|
|00004b30| 62 72 61 72 79 20 6d 6f | 64 75 6c 65 73 20 61 6e |brary mo|dules an|
|00004b40| 64 0a 58 77 69 6c 6c 20 | 74 72 61 70 20 61 73 20 |d.Xwill |trap as |
|00004b50| 6d 61 6e 79 20 65 72 72 | 6f 72 73 20 61 73 20 69 |many err|ors as i|
|00004b60| 74 20 63 61 6e 20 28 79 | 65 73 2c 20 74 68 65 72 |t can (y|es, ther|
|00004b70| 65 20 61 72 65 20 65 72 | 72 6f 72 73 20 74 68 61 |e are er|rors tha|
|00004b80| 74 20 74 68 65 20 6d 61 | 6c 6c 6f 63 0a 58 6c 69 |t the ma|lloc.Xli|
|00004b90| 62 72 61 72 79 20 63 61 | 6e 6e 6f 74 20 63 61 74 |brary ca|nnot cat|
|00004ba0| 63 68 29 2e 20 20 45 6e | 76 69 72 6f 6e 6d 65 6e |ch). En|vironmen|
|00004bb0| 74 20 76 61 72 69 61 62 | 6c 65 73 20 63 61 6e 20 |t variab|les can |
|00004bc0| 62 65 20 75 73 65 64 20 | 74 6f 20 63 6f 6e 74 72 |be used |to contr|
|00004bd0| 6f 6c 20 74 68 65 0a 58 | 62 65 68 61 76 69 6f 72 |ol the.X|behavior|
|00004be0| 20 6f 66 20 74 68 65 20 | 6c 69 62 72 61 72 79 2e | of the |library.|
|00004bf0| 0a 58 2e 50 0a 58 2e 6e | 65 20 31 35 0a 58 5c 66 |.X.P.X.n|e 15.X\f|
|00004c00| 42 4d 4f 44 45 20 32 20 | 2d 20 6d 61 6c 6c 6f 63 |BMODE 2 |- malloc|
|00004c10| 2e 68 20 69 6e 63 6c 75 | 73 69 6f 6e 5c 66 50 0a |.h inclu|sion\fP.|
|00004c20| 58 2e 50 0a 58 54 68 69 | 73 20 6d 6f 64 65 20 69 |X.P.XThi|s mode i|
|00004c30| 6e 76 6f 6c 76 65 73 20 | 69 6e 63 6c 75 64 69 6e |nvolves |includin|
|00004c40| 67 20 74 68 65 20 5c 66 | 42 6d 61 6c 6c 6f 63 2e |g the \f|Bmalloc.|
|00004c50| 68 5c 66 50 20 66 69 6c | 65 20 69 6e 63 6c 75 64 |h\fP fil|e includ|
|00004c60| 65 64 20 77 69 74 68 20 | 74 68 65 20 0a 58 64 65 |ed with |the .Xde|
|00004c70| 62 75 67 67 69 6e 67 20 | 6c 69 62 72 61 72 79 2e |bugging |library.|
|00004c80| 20 20 54 68 65 20 6d 61 | 6c 6c 6f 63 2e 68 20 66 | The ma|lloc.h f|
|00004c90| 69 6c 65 20 69 6e 63 6c | 75 64 65 73 20 6d 61 63 |ile incl|udes mac|
|00004ca0| 72 6f 73 20 74 68 61 74 | 20 77 69 6c 6c 20 69 64 |ros that| will id|
|00004cb0| 65 6e 74 69 66 79 0a 58 | 74 68 65 20 73 6f 75 72 |entify.X|the sour|
|00004cc0| 63 65 20 6c 69 6e 65 20 | 61 6e 64 20 66 69 6c 65 |ce line |and file|
|00004cd0| 20 6e 61 6d 65 20 66 6f | 72 20 65 61 63 68 20 64 | name fo|r each d|
|00004ce0| 65 62 75 67 67 69 6e 67 | 20 66 75 6e 63 74 69 6f |ebugging| functio|
|00004cf0| 6e 20 63 61 6c 6c 65 64 | 2e 20 20 54 68 69 73 0a |n called|. This.|
|00004d00| 58 69 73 20 68 6f 77 20 | 74 68 65 20 6c 69 62 72 |Xis how |the libr|
|00004d10| 61 72 79 20 69 73 20 61 | 62 6c 65 20 74 6f 20 74 |ary is a|ble to t|
|00004d20| 65 6c 6c 20 79 6f 75 20 | 74 68 61 74 20 69 74 20 |ell you |that it |
|00004d30| 77 61 73 20 74 68 65 20 | 63 61 6c 6c 20 74 6f 20 |was the |call to |
|00004d40| 6d 61 6c 6c 6f 63 0a 58 | 6f 6e 20 6c 69 6e 65 20 |malloc.X|on line |
|00004d50| 35 35 20 69 6e 20 66 69 | 6c 65 20 6a 75 6e 6b 2e |55 in fi|le junk.|
|00004d60| 63 2e 0a 58 2e 50 0a 58 | 2e 6e 65 20 38 0a 58 54 |c..X.P.X|.ne 8.XT|
|00004d70| 79 70 69 63 61 6c 6c 79 | 20 79 6f 75 20 73 68 6f |ypically| you sho|
|00004d80| 75 6c 64 20 61 6c 77 61 | 79 73 20 69 6e 63 6c 75 |uld alwa|ys inclu|
|00004d90| 64 65 20 6d 61 6c 6c 6f | 63 2e 68 20 69 6e 20 79 |de mallo|c.h in y|
|00004da0| 6f 75 72 20 73 6f 75 72 | 63 65 20 66 69 6c 65 73 |our sour|ce files|
|00004db0| 20 61 6e 64 20 6a 75 73 | 74 0a 58 75 73 65 20 74 | and jus|t.Xuse t|
|00004dc0| 68 65 20 2d 49 20 49 4e | 43 4c 55 44 45 44 49 52 |he -I IN|CLUDEDIR|
|00004dd0| 20 64 69 72 65 63 74 69 | 76 65 20 66 6f 72 20 74 | directi|ve for t|
|00004de0| 68 65 20 63 6f 6d 70 69 | 6c 65 72 20 74 6f 20 70 |he compi|ler to p|
|00004df0| 6f 69 6e 74 20 74 68 65 | 20 63 6f 6d 70 69 6c 65 |oint the| compile|
|00004e00| 72 20 74 6f 0a 58 74 68 | 65 20 64 65 62 75 67 67 |r to.Xth|e debugg|
|00004e10| 69 6e 67 20 76 65 72 73 | 69 6f 6e 20 6f 66 20 74 |ing vers|ion of t|
|00004e20| 68 65 20 68 65 61 64 65 | 72 20 66 69 6c 65 20 69 |he heade|r file i|
|00004e30| 6e 73 74 65 61 64 20 6f | 66 20 74 68 65 20 6e 6f |nstead o|f the no|
|00004e40| 72 6d 61 6c 20 66 69 6c | 65 2e 20 20 54 68 61 74 |rmal fil|e. That|
|00004e50| 0a 58 77 61 79 20 79 6f | 75 20 64 6f 6e 27 74 20 |.Xway yo|u don't |
|00004e60| 68 61 76 65 20 74 6f 20 | 63 68 61 6e 67 65 20 74 |have to |change t|
|00004e70| 68 65 20 73 6f 75 72 63 | 65 20 66 69 6c 65 73 20 |he sourc|e files |
|00004e80| 77 68 65 6e 20 79 6f 75 | 20 77 61 6e 74 20 74 6f |when you| want to|
|00004e90| 20 74 75 72 6e 20 6f 66 | 66 0a 58 74 68 65 20 64 | turn of|f.Xthe d|
|00004ea0| 65 62 75 67 67 69 6e 67 | 20 6c 69 62 72 61 72 79 |ebugging| library|
|00004eb0| 2e 0a 58 2e 50 0a 58 4e | 4f 54 45 3a 20 4f 6e 63 |..X.P.XN|OTE: Onc|
|00004ec0| 65 20 79 6f 75 20 63 6f | 6d 70 69 6c 65 20 63 6f |e you co|mpile co|
|00004ed0| 64 65 20 69 6e 20 74 68 | 69 73 20 6d 6f 64 65 2c |de in th|is mode,|
|00004ee0| 20 79 6f 75 20 6d 75 73 | 74 20 72 65 63 6f 6d 70 | you mus|t recomp|
|00004ef0| 69 6c 65 20 74 68 65 20 | 63 6f 64 65 20 0a 58 77 |ile the |code .Xw|
|00004f00| 69 74 68 6f 75 74 20 74 | 68 65 20 64 65 62 75 67 |ithout t|he debug|
|00004f10| 67 69 6e 67 20 6d 61 6c | 6c 6f 63 2e 68 20 69 6e |ging mal|loc.h in|
|00004f20| 63 6c 75 64 65 20 66 69 | 6c 65 20 69 6e 20 6f 72 |clude fi|le in or|
|00004f30| 64 65 72 20 74 6f 20 67 | 65 74 20 74 68 65 20 73 |der to g|et the s|
|00004f40| 6f 66 74 77 61 72 65 0a | 58 74 6f 20 75 73 65 20 |oftware.|Xto use |
|00004f50| 74 68 65 20 6e 6f 6e 2d | 64 65 62 75 67 67 69 6e |the non-|debuggin|
|00004f60| 67 20 66 75 6e 63 74 69 | 6f 6e 73 2e 0a 58 2e 50 |g functi|ons..X.P|
|00004f70| 0a 58 2e 6e 65 20 31 30 | 0a 58 5c 66 42 4d 4f 44 |.X.ne 10|.X\fBMOD|
|00004f80| 45 20 33 20 2d 20 72 75 | 6e 2d 74 69 6d 65 20 73 |E 3 - ru|n-time s|
|00004f90| 70 65 63 69 66 69 63 61 | 74 69 6f 6e 20 6f 66 20 |pecifica|tion of |
|00004fa0| 6f 70 74 69 6f 6e 73 5c | 66 50 0a 58 2e 50 0a 58 |options\|fP.X.P.X|
|00004fb0| 45 6e 76 69 72 6f 6e 6d | 65 6e 74 20 76 61 72 69 |Environm|ent vari|
|00004fc0| 61 62 6c 65 73 20 63 61 | 6e 20 62 65 20 75 73 65 |ables ca|n be use|
|00004fd0| 64 20 74 6f 20 63 6f 6e | 74 72 6f 6c 20 74 68 65 |d to con|trol the|
|00004fe0| 20 62 65 68 61 76 69 6f | 72 20 6f 66 20 74 68 65 | behavio|r of the|
|00004ff0| 20 64 65 62 75 67 67 69 | 6e 67 0a 58 6c 69 62 72 | debuggi|ng.Xlibr|
|00005000| 61 72 79 20 74 6f 20 73 | 6f 6d 65 20 65 78 74 65 |ary to s|ome exte|
|00005010| 6e 74 2e 20 20 48 6f 77 | 65 76 65 72 2c 20 74 68 |nt. How|ever, th|
|00005020| 69 73 20 63 6f 6e 74 72 | 6f 6c 20 69 73 20 76 65 |is contr|ol is ve|
|00005030| 72 79 20 63 6f 61 72 73 | 65 20 69 6e 20 74 68 61 |ry coars|e in tha|
|00005040| 74 0a 58 79 6f 75 20 6f | 6e 6c 79 20 68 61 76 65 |t.Xyou o|nly have|
|00005050| 20 6f 6e 65 20 73 65 74 | 74 69 6e 67 20 61 76 61 | one set|ting ava|
|00005060| 69 6c 61 62 6c 65 20 66 | 6f 72 20 74 68 65 20 65 |ilable f|or the e|
|00005070| 6e 74 69 72 65 20 72 75 | 6e 6e 69 6e 67 20 6f 66 |ntire ru|nning of|
|00005080| 20 74 68 65 20 70 72 6f | 67 72 61 6d 2e 0a 58 2e | the pro|gram..X.|
|00005090| 50 0a 58 54 68 69 73 20 | 63 61 6e 20 62 65 20 61 |P.XThis |can be a|
|000050a0| 20 70 72 6f 62 6c 65 6d | 20 69 66 20 79 6f 75 20 | problem| if you |
|000050b0| 77 61 6e 74 20 74 6f 20 | 74 75 72 6e 20 6f 6e 20 |want to |turn on |
|000050c0| 6d 61 6c 6c 6f 63 20 63 | 68 61 69 6e 20 63 68 65 |malloc c|hain che|
|000050d0| 63 6b 69 6e 67 2c 20 62 | 75 74 0a 58 6b 6e 6f 77 |cking, b|ut.Xknow|
|000050e0| 20 74 68 61 74 20 74 68 | 65 20 70 72 6f 62 6c 65 | that th|e proble|
|000050f0| 6d 20 6f 63 63 75 72 73 | 20 62 65 74 77 65 65 6e |m occurs| between|
|00005100| 20 61 20 72 65 6c 61 74 | 69 76 65 6c 79 20 6e 61 | a relat|ively na|
|00005110| 72 72 6f 77 20 70 6f 72 | 74 69 6f 6e 20 6f 66 20 |rrow por|tion of |
|00005120| 74 68 65 0a 58 63 6f 64 | 65 20 61 6e 64 20 64 6f |the.Xcod|e and do|
|00005130| 6e 27 74 20 77 61 6e 74 | 20 74 6f 20 74 61 6b 65 |n't want| to take|
|00005140| 20 74 68 65 20 68 69 74 | 20 6f 66 20 68 61 76 69 | the hit| of havi|
|00005150| 6e 67 20 63 68 61 69 6e | 20 63 68 65 63 6b 69 6e |ng chain| checkin|
|00005160| 67 20 6f 6e 20 66 6f 72 | 20 74 68 65 0a 58 65 6e |g on for| the.Xen|
|00005170| 74 69 72 65 20 70 72 6f | 67 72 61 6d 20 65 78 65 |tire pro|gram exe|
|00005180| 63 75 74 69 6f 6e 2e 20 | 20 0a 58 2e 50 0a 58 2e |cution. | .X.P.X.|
|00005190| 6e 65 20 31 35 0a 58 54 | 68 65 20 73 6f 6c 75 74 |ne 15.XT|he solut|
|000051a0| 69 6f 6e 20 74 6f 20 74 | 68 69 73 20 70 72 6f 62 |ion to t|his prob|
|000051b0| 6c 65 6d 20 69 73 20 74 | 6f 20 69 6e 63 6c 75 64 |lem is t|o includ|
|000051c0| 65 20 63 61 6c 6c 73 20 | 74 6f 20 64 62 6d 61 6c |e calls |to dbmal|
|000051d0| 6c 6f 70 74 28 29 20 77 | 69 74 68 20 74 68 65 0a |lopt() w|ith the.|
|000051e0| 58 64 65 62 75 67 67 69 | 6e 67 20 6f 70 74 69 6f |Xdebuggi|ng optio|
|000051f0| 6e 73 20 77 68 69 63 68 | 20 73 65 74 20 74 68 65 |ns which| set the|
|00005200| 20 61 70 70 72 6f 70 72 | 69 61 74 65 20 6d 6f 64 | appropr|iate mod|
|00005210| 65 73 20 77 68 65 6e 20 | 79 6f 75 20 77 61 6e 74 |es when |you want|
|00005220| 20 74 68 65 6d 20 73 65 | 74 2e 0a 58 53 69 6e 63 | them se|t..XSinc|
|00005230| 65 20 79 6f 75 20 64 6f | 6e 27 74 20 77 61 6e 74 |e you do|n't want|
|00005240| 20 74 6f 20 68 61 76 65 | 20 74 6f 20 63 68 61 6e | to have| to chan|
|00005250| 67 65 20 74 68 65 20 63 | 6f 64 65 20 74 6f 20 72 |ge the c|ode to r|
|00005260| 65 6d 6f 76 65 20 61 6e | 64 20 61 64 64 20 74 68 |emove an|d add th|
|00005270| 65 73 65 0a 58 66 75 6e | 63 74 69 6f 6e 73 20 65 |ese.Xfun|ctions e|
|00005280| 76 65 72 79 20 74 69 6d | 65 20 79 6f 75 20 64 65 |very tim|e you de|
|00005290| 63 69 64 65 20 74 6f 20 | 69 6e 63 6c 75 64 65 20 |cide to |include |
|000052a0| 6d 61 6c 6c 6f 63 20 64 | 65 62 75 67 67 69 6e 67 |malloc d|ebugging|
|000052b0| 20 6f 72 20 6e 6f 74 2c | 20 74 68 65 20 0a 58 5c | or not,| the .X\|
|000052c0| 66 42 6d 61 6c 6c 6f 63 | 2e 68 5c 66 50 20 66 69 |fBmalloc|.h\fP fi|
|000052d0| 6c 65 20 64 65 66 69 6e | 65 73 20 74 68 65 20 70 |le defin|es the p|
|000052e0| 72 65 70 72 6f 63 65 73 | 73 6f 72 20 73 79 6d 62 |reproces|sor symb|
|000052f0| 6f 6c 20 5c 73 2d 32 5f | 44 45 42 55 47 5f 4d 41 |ol \s-2_|DEBUG_MA|
|00005300| 4c 4c 4f 43 5f 49 4e 43 | 5c 73 2b 32 0a 58 77 68 |LLOC_INC|\s+2.Xwh|
|00005310| 69 63 68 20 63 61 6e 20 | 62 65 20 75 73 65 64 20 |ich can |be used |
|00005320| 69 6e 20 79 6f 75 72 20 | 63 6f 64 65 20 61 73 20 |in your |code as |
|00005330| 66 6f 6c 6c 6f 77 73 3a | 0a 58 2e 65 58 0a 58 23 |follows:|.X.eX.X#|
|00005340| 69 66 64 65 66 20 5f 44 | 45 42 55 47 5f 4d 41 4c |ifdef _D|EBUG_MAL|
|00005350| 4c 4f 43 5f 49 4e 43 0a | 58 09 64 62 6d 61 6c 6c |LOC_INC.|X.dbmall|
|00005360| 6f 70 74 28 2e 2e 2e 2e | 20 29 3b 0a 58 23 65 6e |opt(....| );.X#en|
|00005370| 64 69 66 0a 58 2e 65 58 | 0a 58 49 6e 20 61 64 64 |dif.X.eX|.XIn add|
|00005380| 69 74 69 6f 6e 20 74 6f | 20 73 65 74 74 69 6e 67 |ition to| setting|
|00005390| 20 62 65 68 61 76 69 6f | 72 20 6f 70 74 69 6f 6e | behavio|r option|
|000053a0| 73 2c 20 79 6f 75 20 6d | 69 67 68 74 20 77 61 6e |s, you m|ight wan|
|000053b0| 74 20 74 6f 20 6d 61 6b | 65 20 75 73 65 20 6f 66 |t to mak|e use of|
|000053c0| 0a 58 74 68 65 20 6d 65 | 6d 6f 72 79 20 6c 65 61 |.Xthe me|mory lea|
|000053d0| 6b 20 64 65 74 65 63 74 | 69 6f 6e 20 72 6f 75 74 |k detect|ion rout|
|000053e0| 69 6e 65 73 20 69 6e 20 | 74 68 69 73 20 6d 6f 64 |ines in |this mod|
|000053f0| 65 2e 20 20 54 68 65 73 | 65 20 63 61 6c 6c 73 20 |e. Thes|e calls |
|00005400| 73 68 6f 75 6c 64 0a 58 | 61 6c 73 6f 20 62 65 20 |should.X|also be |
|00005410| 73 75 72 72 6f 75 6e 64 | 65 64 20 62 79 20 23 69 |surround|ed by #i|
|00005420| 66 64 65 66 73 20 66 6f | 72 20 74 68 65 20 64 65 |fdefs fo|r the de|
|00005430| 62 75 67 20 6d 61 6c 6c | 6f 63 20 73 79 6d 62 6f |bug mall|oc symbo|
|00005440| 6c 20 73 6f 20 74 68 61 | 74 20 79 6f 75 0a 58 63 |l so tha|t you.Xc|
|00005450| 61 6e 20 6c 65 61 76 65 | 20 74 68 65 6d 20 69 6e |an leave| them in|
|00005460| 20 74 68 65 20 63 6f 64 | 65 20 61 6e 64 20 61 75 | the cod|e and au|
|00005470| 74 6f 6d 61 74 69 63 61 | 6c 6c 79 20 67 65 74 0a |tomatica|lly get.|
|00005480| 58 74 68 65 20 69 6e 63 | 72 65 61 73 65 64 20 66 |Xthe inc|reased f|
|00005490| 75 6e 63 74 69 6f 6e 61 | 6c 69 74 79 20 77 68 65 |unctiona|lity whe|
|000054a0| 6e 65 76 65 72 20 79 6f | 75 20 63 6f 6d 70 69 6c |never yo|u compil|
|000054b0| 65 20 77 69 74 68 20 74 | 68 65 20 64 65 62 75 67 |e with t|he debug|
|000054c0| 67 69 6e 67 20 6c 69 62 | 72 61 72 79 2e 0a 58 2e |ging lib|rary..X.|
|000054d0| 50 0a 58 2e 6e 65 20 31 | 30 0a 58 5c 66 42 4d 4f |P.X.ne 1|0.X\fBMO|
|000054e0| 44 45 20 34 20 2d 20 64 | 65 65 70 65 72 20 69 6e |DE 4 - d|eeper in|
|000054f0| 63 6c 75 73 69 6f 6e 20 | 6f 66 20 6d 61 6c 6c 6f |clusion |of mallo|
|00005500| 63 20 63 61 6c 6c 73 5c | 66 50 0a 58 2e 50 0a 58 |c calls\|fP.X.P.X|
|00005510| 54 68 69 73 20 6d 6f 64 | 65 20 69 6e 76 6f 6c 76 |This mod|e involv|
|00005520| 65 73 20 69 6e 73 65 72 | 74 69 6e 67 20 63 61 6c |es inser|ting cal|
|00005530| 6c 73 20 74 6f 20 74 68 | 65 20 73 70 65 63 69 61 |ls to th|e specia|
|00005540| 6c 20 66 75 6e 63 74 69 | 6f 6e 73 20 73 75 70 70 |l functi|ons supp|
|00005550| 6f 72 74 65 64 0a 58 62 | 79 20 74 68 65 20 6d 61 |orted.Xb|y the ma|
|00005560| 6c 6c 6f 63 20 6c 69 62 | 72 61 72 79 20 28 6c 69 |lloc lib|rary (li|
|00005570| 6b 65 20 74 68 65 20 6c | 65 61 6b 20 64 65 74 65 |ke the l|eak dete|
|00005580| 63 74 69 6f 6e 20 6f 72 | 20 73 74 61 63 6b 20 6d |ction or| stack m|
|00005590| 61 69 6e 74 65 6e 61 6e | 63 65 20 0a 58 72 6f 75 |aintenan|ce .Xrou|
|000055a0| 74 69 6e 65 73 29 2e 20 | 20 54 68 65 20 65 66 66 |tines). | The eff|
|000055b0| 65 63 74 73 20 6f 66 20 | 74 68 65 20 69 6e 63 6c |ects of |the incl|
|000055c0| 75 73 69 6f 6e 73 20 64 | 65 70 65 6e 64 73 20 75 |usions d|epends u|
|000055d0| 70 6f 6e 20 74 68 65 20 | 6d 6f 64 75 6c 65 73 0a |pon the |modules.|
|000055e0| 58 69 6e 63 6c 75 64 65 | 64 20 61 6e 64 20 74 68 |Xinclude|d and th|
|000055f0| 65 20 61 6d 6f 75 6e 74 | 20 74 6f 20 77 68 69 63 |e amount| to whic|
|00005600| 68 20 74 68 65 79 20 61 | 72 65 20 75 73 65 64 2e |h they a|re used.|
|00005610| 20 0a 58 2e 50 0a 58 49 | 74 20 69 73 20 73 74 72 | .X.P.XI|t is str|
|00005620| 6f 6e 67 6c 79 20 72 65 | 63 6f 6d 6d 65 6e 64 65 |ongly re|commende|
|00005630| 64 20 74 68 61 74 20 79 | 6f 75 20 73 65 74 75 70 |d that y|ou setup|
|00005640| 20 79 6f 75 72 20 63 6f | 64 65 20 77 69 74 68 20 | your co|de with |
|00005650| 74 68 65 20 66 6f 6c 6c | 6f 77 69 6e 67 0a 58 6c |the foll|owing.Xl|
|00005660| 69 6e 65 73 20 69 6e 20 | 61 20 68 65 61 64 65 72 |ines in |a header|
|00005670| 20 66 69 6c 65 20 74 68 | 61 74 20 69 73 20 69 6e | file th|at is in|
|00005680| 63 6c 75 64 65 64 20 62 | 79 20 61 6c 6c 20 6d 6f |cluded b|y all mo|
|00005690| 64 75 6c 65 73 2c 20 6f | 72 20 6a 75 73 74 20 61 |dules, o|r just a|
|000056a0| 64 64 20 74 68 65 0a 58 | 63 6f 64 65 20 74 6f 20 |dd the.X|code to |
|000056b0| 74 68 65 20 62 65 67 69 | 6e 6e 69 6e 67 20 6f 66 |the begi|nning of|
|000056c0| 20 74 68 65 20 6d 6f 64 | 75 6c 65 73 20 74 68 65 | the mod|ules the|
|000056d0| 6d 73 65 6c 76 65 73 3a | 0a 58 2e 65 58 0a 58 23 |mselves:|.X.eX.X#|
|000056e0| 69 66 6e 64 65 66 20 5f | 44 45 42 55 47 5f 4d 41 |ifndef _|DEBUG_MA|
|000056f0| 4c 4c 4f 43 5f 49 4e 43 | 0a 58 23 64 65 66 69 6e |LLOC_INC|.X#defin|
|00005700| 65 20 6d 61 6c 6c 6f 63 | 5f 65 6e 74 65 72 28 66 |e malloc|_enter(f|
|00005710| 75 6e 63 29 0a 58 23 64 | 65 66 69 6e 65 20 6d 61 |unc).X#d|efine ma|
|00005720| 6c 6c 6f 63 5f 6c 65 61 | 76 65 28 66 75 6e 63 29 |lloc_lea|ve(func)|
|00005730| 0a 58 23 64 65 66 69 6e | 65 20 6d 61 6c 6c 6f 63 |.X#defin|e malloc|
|00005740| 5f 63 68 61 69 6e 5f 63 | 68 65 63 6b 28 29 0a 58 |_chain_c|heck().X|
|00005750| 23 64 65 66 69 6e 65 20 | 6d 61 6c 6c 6f 63 5f 64 |#define |malloc_d|
|00005760| 75 6d 70 28 66 64 29 0a | 58 23 64 65 66 69 6e 65 |ump(fd).|X#define|
|00005770| 20 6d 61 6c 6c 6f 63 5f | 6c 69 73 74 28 61 2c 62 | malloc_|list(a,b|
|00005780| 2c 63 29 0a 58 23 64 65 | 66 69 6e 65 20 6d 61 6c |,c).X#de|fine mal|
|00005790| 6c 6f 63 5f 69 6e 75 73 | 65 28 68 69 73 74 29 09 |loc_inus|e(hist).|
|000057a0| 28 2a 28 68 69 73 74 29 | 20 3d 20 30 2c 20 30 29 |(*(hist)| = 0, 0)|
|000057b0| 0a 58 23 65 6e 64 69 66 | 0a 58 2e 65 58 0a 58 54 |.X#endif|.X.eX.XT|
|000057c0| 68 69 73 20 77 69 6c 6c | 20 61 75 74 6f 6d 61 74 |his will| automat|
|000057d0| 69 63 61 6c 6c 79 20 64 | 69 73 61 62 6c 65 20 74 |ically d|isable t|
|000057e0| 68 65 20 72 65 66 65 72 | 65 6e 63 65 64 20 66 75 |he refer|enced fu|
|000057f0| 6e 63 74 69 6f 6e 73 20 | 77 68 65 6e 20 74 68 65 |nctions |when the|
|00005800| 20 6d 61 6c 6c 6f 63 0a | 58 6c 69 62 72 61 72 79 | malloc.|Xlibrary|
|00005810| 20 69 73 20 6e 6f 74 20 | 69 6e 63 6c 75 64 65 64 | is not |included|
|00005820| 20 28 61 73 20 73 68 6f | 75 6c 64 20 62 65 20 74 | (as sho|uld be t|
|00005830| 68 65 20 63 61 73 65 20 | 77 68 65 6e 20 79 6f 75 |he case |when you|
|00005840| 20 6d 61 6b 65 20 61 20 | 70 72 6f 64 75 63 74 69 | make a |producti|
|00005850| 6f 6e 0a 58 62 75 69 6c | 64 29 2e 0a 58 2e 62 72 |on.Xbuil|d)..X.br|
|00005860| 0a 58 2e 6e 65 20 31 35 | 0a 58 2e 53 48 20 22 45 |.X.ne 15|.X.SH "E|
|00005870| 4e 56 49 52 4f 4e 4d 45 | 4e 54 20 56 41 52 49 41 |NVIRONME|NT VARIA|
|00005880| 42 4c 45 53 22 0a 58 45 | 6e 76 69 72 6f 6e 6d 65 |BLES".XE|nvironme|
|00005890| 6e 74 20 76 61 72 69 61 | 62 6c 65 73 20 63 61 6e |nt varia|bles can|
|000058a0| 20 62 65 20 75 73 65 64 | 20 74 6f 20 63 6f 6e 74 | be used| to cont|
|000058b0| 72 6f 6c 20 65 72 72 6f | 72 20 68 61 6e 64 6c 69 |rol erro|r handli|
|000058c0| 6e 67 2c 20 65 72 72 6f | 72 20 6c 6f 67 67 69 6e |ng, erro|r loggin|
|000058d0| 67 0a 58 61 6e 64 20 6d | 61 6c 6c 6f 63 20 63 68 |g.Xand m|alloc ch|
|000058e0| 61 69 6e 20 63 68 65 63 | 6b 69 6e 67 20 61 74 20 |ain chec|king at |
|000058f0| 72 75 6e 20 74 69 6d 65 | 2e 20 20 4d 6f 73 74 20 |run time|. Most |
|00005900| 6f 66 20 74 68 65 73 65 | 20 65 6e 76 69 72 6f 6e |of these| environ|
|00005910| 6d 65 6e 74 20 76 61 72 | 69 61 62 6c 65 73 0a 58 |ment var|iables.X|
|00005920| 63 61 6e 20 62 65 20 73 | 65 74 20 76 69 61 20 74 |can be s|et via t|
|00005930| 68 65 20 5c 66 42 64 62 | 6d 61 6c 6c 6f 70 74 5c |he \fBdb|mallopt\|
|00005940| 66 50 28 29 20 72 6f 75 | 74 69 6e 65 20 61 6e 64 |fP() rou|tine and|
|00005950| 20 61 72 65 20 77 65 6c | 6c 20 64 65 73 63 72 69 | are wel|l descri|
|00005960| 62 65 64 20 69 6e 20 0a | 58 74 68 61 74 20 70 6f |bed in .|Xthat po|
|00005970| 72 74 69 6f 6e 20 6f 66 | 20 74 68 65 20 64 6f 63 |rtion of| the doc|
|00005980| 75 6d 65 6e 74 2e 20 20 | 4c 6f 6f 6b 20 66 6f 72 |ument. |Look for|
|00005990| 20 66 75 72 74 68 65 72 | 20 69 6e 66 6f 72 6d 61 | further| informa|
|000059a0| 74 69 6f 6e 20 74 68 65 | 72 65 2e 0a 58 2e 4d 50 |tion the|re..X.MP|
|000059b0| 0a 58 54 68 65 20 66 6f | 6c 6c 6f 77 69 6e 67 20 |.XThe fo|llowing |
|000059c0| 65 6e 76 69 72 6f 6e 6d | 65 6e 74 20 76 61 72 69 |environm|ent vari|
|000059d0| 61 62 6c 65 73 20 61 72 | 65 20 75 73 65 64 3a 0a |ables ar|e used:.|
|000059e0| 58 2e 50 0a 58 2e 56 4c | 20 31 30 0a 58 2e 62 72 |X.P.X.VL| 10.X.br|
|000059f0| 0a 58 2e 6e 65 20 34 0a | 58 2e 4c 49 20 22 5c 73 |.X.ne 4.|X.LI "\s|
|00005a00| 2d 32 4d 41 4c 4c 4f 43 | 5f 42 4f 55 4e 44 53 49 |-2MALLOC|_BOUNDSI|
|00005a10| 5a 45 5c 73 2b 32 22 0a | 58 54 68 69 73 20 73 70 |ZE\s+2".|XThis sp|
|00005a20| 65 63 69 66 69 65 73 20 | 74 68 65 20 6d 69 6e 69 |ecifies |the mini|
|00005a30| 6d 75 6d 20 6e 75 6d 62 | 65 72 20 6f 66 20 62 79 |mum numb|er of by|
|00005a40| 74 65 73 20 74 68 61 74 | 20 74 68 65 20 61 6c 6c |tes that| the all|
|00005a50| 6f 63 61 74 69 6f 6e 20 | 72 6f 75 74 69 6e 65 73 |ocation |routines|
|00005a60| 0a 58 77 69 6c 6c 20 6c | 65 61 76 65 20 75 6e 75 |.Xwill l|eave unu|
|00005a70| 73 65 64 20 61 74 20 74 | 68 65 20 65 6e 64 20 6f |sed at t|he end o|
|00005a80| 66 20 65 61 63 68 20 73 | 65 67 6d 65 6e 74 2e 20 |f each s|egment. |
|00005a90| 20 54 68 69 73 20 76 61 | 6c 75 65 20 6d 61 79 20 | This va|lue may |
|00005aa0| 62 65 0a 58 61 6e 79 20 | 6e 6f 6e 2d 7a 65 72 6f |be.Xany |non-zero|
|00005ab0| 20 70 6f 73 69 74 69 76 | 65 20 69 6e 74 65 67 65 | positiv|e intege|
|00005ac0| 72 20 28 61 6c 74 68 6f | 75 67 68 20 79 6f 75 20 |r (altho|ugh you |
|00005ad0| 6d 75 73 74 20 72 65 6d | 65 6d 62 65 72 20 74 68 |must rem|ember th|
|00005ae0| 61 74 20 74 68 65 0a 58 | 61 6d 6f 75 6e 74 20 6f |at the.X|amount o|
|00005af0| 66 20 6d 65 6d 6f 72 79 | 20 75 73 65 64 20 69 73 |f memory| used is|
|00005b00| 20 64 69 72 65 63 74 6c | 79 20 72 65 6c 61 74 65 | directl|y relate|
|00005b10| 64 20 74 6f 20 74 68 69 | 73 20 62 75 66 66 65 72 |d to thi|s buffer|
|00005b20| 20 61 72 65 61 2e 0a 58 | 2e 4d 50 0a 58 49 74 20 | area..X|.MP.XIt |
|00005b30| 6d 61 79 20 62 65 20 6e | 65 63 65 73 73 61 72 79 |may be n|ecessary|
|00005b40| 20 74 6f 20 69 6e 63 72 | 65 61 73 65 20 74 68 69 | to incr|ease thi|
|00005b50| 73 20 76 61 6c 75 65 20 | 69 66 20 79 6f 75 20 74 |s value |if you t|
|00005b60| 68 69 6e 6b 20 79 6f 75 | 20 68 61 76 65 20 61 20 |hink you| have a |
|00005b70| 6d 6f 64 75 6c 65 0a 58 | 74 68 61 74 20 69 73 20 |module.X|that is |
|00005b80| 77 72 69 74 69 6e 67 20 | 66 61 72 20 65 6e 6f 75 |writing |far enou|
|00005b90| 67 68 20 62 65 79 6f 6e | 64 20 69 74 73 20 6d 61 |gh beyon|d its ma|
|00005ba0| 6c 6c 6f 63 20 73 65 67 | 6d 65 6e 74 20 74 68 61 |lloc seg|ment tha|
|00005bb0| 74 20 69 74 20 63 68 61 | 6e 67 65 73 20 74 68 65 |t it cha|nges the|
|00005bc0| 0a 58 6e 65 78 74 20 73 | 65 67 6d 65 6e 74 20 28 |.Xnext s|egment (|
|00005bd0| 61 6e 64 20 74 68 65 72 | 65 66 6f 72 65 20 64 6f |and ther|efore do|
|00005be0| 65 73 6e 27 74 20 6d 61 | 6b 65 20 61 20 63 68 61 |esn't ma|ke a cha|
|00005bf0| 6e 67 65 20 74 68 61 74 | 20 74 68 69 73 20 6c 69 |nge that| this li|
|00005c00| 62 72 61 72 79 0a 58 77 | 6f 75 6c 64 20 62 65 20 |brary.Xw|ould be |
|00005c10| 61 62 6c 65 20 74 6f 20 | 64 65 74 65 63 74 2e 0a |able to |detect..|
|00005c20| 58 2e 4d 50 0a 58 54 68 | 65 20 64 65 66 61 75 6c |X.MP.XTh|e defaul|
|00005c30| 74 20 66 6f 72 20 74 68 | 69 73 20 76 61 6c 75 65 |t for th|is value|
|00005c40| 20 69 73 20 31 20 28 61 | 6c 74 68 6f 75 67 68 20 | is 1 (a|lthough |
|00005c50| 62 65 63 61 75 73 65 20 | 6f 66 20 6d 65 6d 6f 72 |because |of memor|
|00005c60| 79 20 61 6c 69 67 6e 6d | 65 6e 74 0a 58 69 73 73 |y alignm|ent.Xiss|
|00005c70| 75 65 73 2c 20 79 6f 75 | 20 77 69 6c 6c 20 75 73 |ues, you| will us|
|00005c80| 75 61 6c 6c 79 20 68 61 | 76 65 20 6d 6f 72 65 20 |ually ha|ve more |
|00005c90| 74 68 61 6e 20 6f 6e 65 | 20 62 79 74 65 20 6f 66 |than one| byte of|
|00005ca0| 20 66 69 6c 6c 65 72 20 | 61 74 20 74 68 65 0a 58 | filler |at the.X|
|00005cb0| 65 6e 64 20 6f 66 20 6d | 6f 73 74 20 73 65 67 6d |end of m|ost segm|
|00005cc0| 65 6e 74 73 29 2e 0a 58 | 2e 62 72 0a 58 2e 6e 65 |ents)..X|.br.X.ne|
|00005cd0| 20 34 0a 58 2e 4c 49 20 | 22 5c 73 2d 32 4d 41 4c | 4.X.LI |"\s-2MAL|
|00005ce0| 4c 4f 43 5f 43 4b 43 48 | 41 49 4e 5c 73 2b 32 22 |LOC_CKCH|AIN\s+2"|
|00005cf0| 0a 58 69 66 20 31 2c 20 | 74 75 72 6e 73 20 6f 6e |.Xif 1, |turns on|
|00005d00| 20 6d 61 6c 6c 6f 63 20 | 63 68 61 69 6e 20 63 68 | malloc |chain ch|
|00005d10| 65 63 6b 69 6e 67 20 61 | 74 20 65 76 65 72 79 20 |ecking a|t every |
|00005d20| 63 61 6c 6c 20 74 6f 20 | 61 6e 79 0a 58 6f 66 20 |call to |any.Xof |
|00005d30| 74 68 65 20 6d 61 6c 6c | 6f 63 20 66 75 6e 63 74 |the mall|oc funct|
|00005d40| 69 6f 6e 73 2e 0a 58 2e | 62 72 0a 58 2e 6e 65 20 |ions..X.|br.X.ne |
|00005d50| 34 0a 58 2e 4c 49 20 22 | 5c 73 2d 32 4d 41 4c 4c |4.X.LI "|\s-2MALL|
|00005d60| 4f 43 5f 44 45 54 41 49 | 4c 5c 73 2b 32 22 0a 58 |OC_DETAI|L\s+2".X|
|00005d70| 69 66 20 73 65 74 20 74 | 6f 20 61 20 6e 6f 6e 2d |if set t|o a non-|
|00005d80| 7a 65 72 6f 20 69 6e 74 | 65 67 65 72 2c 20 5c 66 |zero int|eger, \f|
|00005d90| 42 6d 61 6c 6c 6f 63 5f | 64 75 6d 70 5c 66 50 20 |Bmalloc_|dump\fP |
|00005da0| 73 68 6f 77 73 20 73 6f | 6d 65 20 69 6e 74 65 72 |shows so|me inter|
|00005db0| 6e 61 6c 0a 58 64 65 74 | 61 69 6c 20 66 6f 72 20 |nal.Xdet|ail for |
|00005dc0| 65 61 63 68 20 0a 58 65 | 6e 74 72 79 20 69 6e 20 |each .Xe|ntry in |
|00005dd0| 74 68 65 20 63 68 61 69 | 6e 2e 20 20 54 68 69 73 |the chai|n. This|
|00005de0| 20 69 6e 66 6f 20 69 73 | 20 70 72 6f 62 61 62 6c | info is| probabl|
|00005df0| 79 20 6f 6e 6c 79 20 6f | 66 20 75 73 65 20 69 66 |y only o|f use if|
|00005e00| 20 79 6f 75 20 61 72 65 | 20 64 65 62 75 67 67 69 | you are| debuggi|
|00005e10| 6e 67 20 0a 58 74 68 65 | 20 6d 61 6c 6c 6f 63 20 |ng .Xthe| malloc |
|00005e20| 6c 69 62 72 61 72 79 20 | 69 74 73 65 6c 66 2e 0a |library |itself..|
|00005e30| 58 2e 62 72 0a 58 2e 6e | 65 20 34 0a 58 2e 4c 49 |X.br.X.n|e 4.X.LI|
|00005e40| 20 22 5c 73 2d 32 4d 41 | 4c 4c 4f 43 5f 45 52 52 | "\s-2MA|LLOC_ERR|
|00005e50| 46 49 4c 45 5c 73 2b 32 | 22 0a 58 73 70 65 63 69 |FILE\s+2|".Xspeci|
|00005e60| 66 69 65 73 20 74 68 65 | 20 65 72 72 6f 72 20 6c |fies the| error l|
|00005e70| 6f 67 20 66 69 6c 65 20 | 66 6f 72 20 65 72 72 6f |og file |for erro|
|00005e80| 72 20 6d 65 73 73 61 67 | 65 73 2e 20 20 45 72 72 |r messag|es. Err|
|00005e90| 6f 72 20 6d 65 73 73 61 | 67 65 73 20 67 65 6e 65 |or messa|ges gene|
|00005ea0| 72 61 74 65 64 0a 58 62 | 79 20 74 68 65 20 6c 69 |rated.Xb|y the li|
|00005eb0| 62 72 61 72 79 20 61 72 | 65 20 5c 66 42 41 50 50 |brary ar|e \fBAPP|
|00005ec0| 45 4e 44 45 44 5c 66 50 | 20 74 6f 20 74 68 69 73 |ENDED\fP| to this|
|00005ed0| 20 66 69 6c 65 2c 20 73 | 6f 20 69 66 20 79 6f 75 | file, s|o if you|
|00005ee0| 20 77 61 6e 74 20 61 20 | 63 6c 65 61 6e 20 66 69 | want a |clean fi|
|00005ef0| 6c 65 2c 0a 58 79 6f 75 | 20 77 69 6c 6c 20 68 61 |le,.Xyou| will ha|
|00005f00| 76 65 20 74 6f 20 72 65 | 6d 6f 76 65 20 6f 72 20 |ve to re|move or |
|00005f10| 65 6d 70 74 79 20 69 74 | 20 79 6f 75 72 73 65 6c |empty it| yoursel|
|00005f20| 66 20 62 65 74 77 65 65 | 6e 20 72 75 6e 73 2e 20 |f betwee|n runs. |
|00005f30| 20 49 66 20 74 68 69 73 | 20 6f 70 74 69 6f 6e 0a | If this| option.|
|00005f40| 58 69 73 20 75 73 65 64 | 2c 20 6e 6f 20 69 6e 64 |Xis used|, no ind|
|00005f50| 69 63 61 74 69 6f 6e 20 | 6f 66 20 61 6e 20 65 72 |ication |of an er|
|00005f60| 72 6f 72 20 77 69 6c 6c | 20 62 65 20 73 65 6e 74 |ror will| be sent|
|00005f70| 20 74 6f 20 73 74 64 6f | 75 74 20 6f 72 20 73 74 | to stdo|ut or st|
|00005f80| 64 65 72 72 20 28 74 68 | 69 73 20 0a 58 69 73 20 |derr (th|is .Xis |
|00005f90| 70 75 72 70 6f 73 65 66 | 75 6c 6c 79 20 64 6f 6e |purposef|ully don|
|00005fa0| 65 20 74 68 69 73 20 77 | 61 79 20 73 6f 20 74 68 |e this w|ay so th|
|00005fb0| 61 74 20 69 66 20 79 6f | 75 20 61 72 65 20 72 75 |at if yo|u are ru|
|00005fc0| 6e 6e 69 6e 67 20 61 20 | 66 75 6c 6c 20 73 63 72 |nning a |full scr|
|00005fd0| 65 65 6e 20 0a 58 70 72 | 6f 67 72 61 6d 2c 20 69 |een .Xpr|ogram, i|
|00005fe0| 74 20 64 6f 65 73 6e 27 | 74 20 6d 65 73 73 20 75 |t doesn'|t mess u|
|00005ff0| 70 20 74 68 65 20 73 63 | 72 65 65 6e 29 2e 0a 58 |p the sc|reen)..X|
|00006000| 2e 62 72 0a 58 2e 6e 65 | 20 34 0a 58 2e 4c 49 20 |.br.X.ne| 4.X.LI |
|00006010| 22 5c 73 2d 32 4d 41 4c | 4c 4f 43 5f 46 41 54 41 |"\s-2MAL|LOC_FATA|
|00006020| 4c 5c 73 2b 32 22 0a 58 | 73 70 65 63 69 66 69 65 |L\s+2".X|specifie|
|00006030| 73 20 74 68 65 20 65 72 | 72 6f 72 20 68 61 6e 64 |s the er|ror hand|
|00006040| 6c 69 6e 67 20 66 6f 72 | 20 66 61 74 61 6c 20 65 |ling for| fatal e|
|00006050| 72 72 6f 72 73 0a 58 2e | 62 72 0a 58 2e 6e 65 20 |rrors.X.|br.X.ne |
|00006060| 34 0a 58 2e 4c 49 20 22 | 5c 73 2d 32 4d 41 4c 4c |4.X.LI "|\s-2MALL|
|00006070| 4f 43 5f 46 49 4c 4c 41 | 52 45 41 5c 73 2b 32 22 |OC_FILLA|REA\s+2"|
|00006080| 0a 58 73 70 65 63 69 66 | 69 65 73 20 74 68 65 20 |.Xspecif|ies the |
|00006090| 66 69 6c 6c 20 61 72 65 | 61 20 66 6c 61 67 20 73 |fill are|a flag s|
|000060a0| 65 74 74 69 6e 67 2e 20 | 20 49 66 20 7a 65 72 6f |etting. | If zero|
|000060b0| 2c 20 6d 61 6c 6c 6f 63 | 2f 66 72 65 65 20 61 72 |, malloc|/free ar|
|000060c0| 65 61 20 66 69 6c 6c 69 | 6e 67 20 0a 58 61 6e 64 |ea filli|ng .Xand|
|000060d0| 20 63 68 65 63 6b 69 6e | 67 20 69 73 20 64 69 73 | checkin|g is dis|
|000060e0| 61 62 6c 65 64 20 28 74 | 68 65 72 65 62 79 20 69 |abled (t|hereby i|
|000060f0| 6e 63 72 65 61 73 69 6e | 67 20 70 65 72 66 6f 72 |ncreasin|g perfor|
|00006100| 6d 61 6e 63 65 2c 20 77 | 68 69 6c 65 20 64 65 63 |mance, w|hile dec|
|00006110| 72 65 61 73 69 6e 67 0a | 58 65 66 66 65 63 74 69 |reasing.|Xeffecti|
|00006120| 76 65 6e 65 73 73 20 6f | 66 20 74 68 65 20 6c 69 |veness o|f the li|
|00006130| 62 72 61 72 79 29 2e 20 | 20 53 65 65 20 74 68 65 |brary). | See the|
|00006140| 20 64 69 73 63 75 73 73 | 69 6f 6e 20 6f 66 20 74 | discuss|ion of t|
|00006150| 68 65 20 5c 66 42 64 62 | 6d 61 6c 6c 6f 70 74 5c |he \fBdb|mallopt\|
|00006160| 66 50 28 29 0a 58 61 72 | 67 75 6d 65 6e 74 73 20 |fP().Xar|guments |
|00006170| 66 6f 72 20 6d 6f 72 65 | 20 69 6e 66 6f 20 6f 6e |for more| info on|
|00006180| 20 6f 74 68 65 72 20 73 | 65 74 74 69 6e 67 73 2e | other s|ettings.|
|00006190| 0a 58 2e 62 72 0a 58 2e | 6e 65 20 35 0a 58 2e 4c |.X.br.X.|ne 5.X.L|
|000061a0| 49 20 22 5c 73 2d 32 4d | 41 4c 4c 4f 43 5f 46 49 |I "\s-2M|ALLOC_FI|
|000061b0| 4c 4c 42 59 54 45 5c 73 | 2b 32 22 0a 58 54 68 69 |LLBYTE\s|+2".XThi|
|000061c0| 73 20 73 70 65 63 69 66 | 69 65 73 20 74 68 65 20 |s specif|ies the |
|000061d0| 69 6e 74 65 67 65 72 20 | 76 61 6c 75 65 20 6f 66 |integer |value of|
|000061e0| 20 74 68 65 20 63 68 61 | 72 61 63 74 65 72 20 74 | the cha|racter t|
|000061f0| 6f 20 75 73 65 20 77 68 | 65 6e 20 66 69 6c 6c 69 |o use wh|en filli|
|00006200| 6e 67 0a 58 61 6c 6c 6f | 63 61 74 65 64 20 61 72 |ng.Xallo|cated ar|
|00006210| 65 61 73 2e 20 20 54 68 | 69 73 20 76 61 6c 75 65 |eas. Th|is value|
|00006220| 20 64 65 66 61 75 6c 74 | 73 20 74 6f 20 31 20 61 | default|s to 1 a|
|00006230| 6e 64 20 6d 75 73 74 20 | 62 65 20 77 69 74 68 69 |nd must |be withi|
|00006240| 6e 20 74 68 65 20 72 61 | 6e 67 65 0a 58 6f 66 20 |n the ra|nge.Xof |
|00006250| 30 20 2d 20 32 35 35 2e | 20 54 68 69 73 20 63 61 |0 - 255.| This ca|
|00006260| 70 61 62 69 6c 69 74 79 | 20 69 73 20 75 73 65 66 |pability| is usef|
|00006270| 75 6c 20 69 66 20 79 6f | 75 20 62 65 6c 69 65 76 |ul if yo|u believ|
|00006280| 65 20 74 68 61 74 20 79 | 6f 75 20 61 72 65 20 0a |e that y|ou are .|
|00006290| 58 68 61 76 69 6e 67 20 | 61 20 70 72 6f 62 6c 65 |Xhaving |a proble|
|000062a0| 6d 20 77 69 74 68 20 63 | 6f 64 65 20 74 68 61 74 |m with c|ode that|
|000062b0| 20 69 73 20 74 72 61 73 | 68 69 6e 67 20 69 74 73 | is tras|hing its|
|000062c0| 20 6d 61 6c 6c 6f 63 20 | 72 65 67 69 6f 6e 20 77 | malloc |region w|
|000062d0| 69 74 68 0a 58 61 20 64 | 61 74 61 20 70 61 74 74 |ith.Xa d|ata patt|
|000062e0| 65 72 6e 20 74 68 61 74 | 20 6d 61 74 63 68 65 73 |ern that| matches|
|000062f0| 20 74 68 65 20 64 65 66 | 61 75 6c 74 20 66 69 6c | the def|ault fil|
|00006300| 6c 20 70 61 74 74 65 72 | 6e 2e 0a 58 2e 4d 50 0a |l patter|n..X.MP.|
|00006310| 58 4e 4f 54 45 3a 20 69 | 66 20 61 6e 20 61 74 74 |XNOTE: i|f an att|
|00006320| 65 6d 70 74 20 69 73 20 | 6d 61 64 65 20 74 6f 20 |empt is |made to |
|00006330| 75 73 65 20 61 20 76 61 | 6c 75 65 20 6f 75 74 73 |use a va|lue outs|
|00006340| 69 64 65 20 74 68 65 20 | 73 70 65 63 69 66 69 65 |ide the |specifie|
|00006350| 64 0a 58 72 61 6e 67 65 | 2c 20 74 68 65 20 6e 65 |d.Xrange|, the ne|
|00006360| 77 20 76 61 6c 75 65 20 | 69 73 20 5c 66 42 73 69 |w value |is \fBsi|
|00006370| 6c 65 6e 74 6c 79 5c 66 | 50 20 69 67 6e 6f 72 65 |lently\f|P ignore|
|00006380| 64 20 61 6e 64 20 74 68 | 65 20 64 65 66 61 75 6c |d and th|e defaul|
|00006390| 74 20 69 73 20 75 73 65 | 64 2e 0a 58 2e 62 72 0a |t is use|d..X.br.|
|000063a0| 58 2e 6e 65 20 35 0a 58 | 2e 4c 49 20 22 5c 73 2d |X.ne 5.X|.LI "\s-|
|000063b0| 32 4d 41 4c 4c 4f 43 5f | 46 52 45 45 42 59 54 45 |2MALLOC_|FREEBYTE|
|000063c0| 5c 73 2b 32 22 0a 58 54 | 68 69 73 20 73 70 65 63 |\s+2".XT|his spec|
|000063d0| 69 66 69 65 73 20 74 68 | 65 20 69 6e 74 65 67 65 |ifies th|e intege|
|000063e0| 72 20 76 61 6c 75 65 20 | 6f 66 20 74 68 65 20 63 |r value |of the c|
|000063f0| 68 61 72 61 63 74 65 72 | 20 74 6f 20 75 73 65 20 |haracter| to use |
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.