%!PS-Adobe-1.0 %%Creator: devps (Pipeline Associates, Inc.) %%CreationDate: Fri Sep 13 13:06:50 1996 %%Pages: (atend) %%DocumentFonts: (atend) /devps 180 dict def devps begin /res 10.000000 def /y_offset 843 def /X{exch}bind def /mm {transform round X round X itransform} bind def /r{rmoveto}bind def /m{moveto}bind def /l{lineto}bind def /rl{rlineto}bind def /st{stroke}bind def /gs{gsave}bind def /gr{grestore}bind def /cp{currentpoint}bind def /np{newpath}bind def /ct{curveto}bind def systemdict /setpacking known { /savepacking currentpacking def true setpacking } if /m0{0 0 moveto}bind def /xc{//res div}bind def /yc{//res neg div //y_offset add}bind def /lc{yc X xc X l st}bind def /mc{yc X xc X m}bind def /el{gs /a X def a div 1 X scale cp np a xc 2 div 0 360 arc st gr}bind def /ar{cp 7 2 roll np xc 5 1 roll atan 3 1 roll atan X arc st}bind def /sp{yc X xc X 6 2 roll yc X xc X 6 2 roll yc X xc X 6 2 roll ct}bind def /V{//res neg div //y_offset add currentpoint pop X m}bind def /H{//res div 0 transform X round X itransform pop currentpoint X pop moveto}bind def /h{//res div 0 r}bind def /v{//res neg div 0 X r}bind def /S{X H show}bind def /A{H //res div 1 index stringwidth pop sub 1 index length div 0 3 2 roll ashow}bind def /psize 10 def /height 0 def /cheight { height 0 ne { height } { psize } ifelse } bind def /slant 0 def /FF{findfont X dup 30 div 0 mm pop setlinewidth /psize X def [psize 0 cheight slant sin slant cos div mul cheight 0 0] makefont setfont}bind def /shade{gs /dy X def /dx X def np m 0 /dy rl /dx 0 rl 0 /dy neg rl /dx neg 0 rl closepath .9 setgray fill gr}bind def 1 setlinecap /resolution res 72 mul def /startFig { /SavedState save def userdict maxlength dict begin currentpoint transform DocumentInitState setmiterlimit setgray setdash setlinejoin setlinecap setlinewidth setmatrix itransform moveto /ury exch def /urx exch def /lly exch def /llx exch def /y exch 72 mul resolution div def /x exch 72 mul resolution div def currentpoint /cy exch def /cx exch def /sx x urx llx sub div def /sy y ury lly sub div def sx sy scale cx sx div llx sub cy sy div ury sub translate /DefFigCTM matrix currentmatrix def /initmatrix { DefFigCTM setmatrix } def /defaultmatrix { DefFigCTM exch copy } def /initgraphics { DocumentInitState setmiterlimit setgray setdash setlinejoin setlinecap setlinewidth setmatrix DefFigCTM setmatrix } def /showpage { initgraphics } def }bind def /clipFig { currentpoint 6 2 roll newpath 4 copy 4 2 roll moveto 6 -1 roll exch lineto exch lineto exch lineto closepath clip newpath moveto }bind def /doclip { llx lly urx ury clipFig } def /endFig { end SavedState restore }bind def /globalstart { fontnum psize slant height resolution currentpoint pagesave restore gsave }bind def /globalend { grestore moveto /resolution exch def /height exch def /slant exch def /psize exch def /fontnum exch def F /pagesave save def }bind def /fontnum 1 def systemdict /setpacking known { savepacking setpacking} if end /BP{ save mark devps begin m0 /DocumentInitState [ matrix currentmatrix currentlinewidth currentlinecap currentlinejoin currentdash currentgray currentmiterlimit ] cvx def }bind def /EP{ end cleartomark restore showpage}def /Encoding-1 256 array def 0 1 255 {Encoding-1 exch /.notdef put} for Encoding-1 8#301 StandardEncoding 8#101 26 getinterval putinterval %A-B Encoding-1 8#341 StandardEncoding 8#141 26 getinterval putinterval %a-b Encoding-1 8#241 StandardEncoding 8#301 16 getinterval putinterval %accents Encoding-1 8#373 StandardEncoding 8#365 1 getinterval putinterval %dotlessi Encoding-1 dup 8#41 /copyright put dup 8#42 /registered put dup 8#43 /trademark put dup 8#44 /logicalnot put dup 8#45 /Eth put dup 8#46 /eth put dup 8#47 /Thorn put dup 8#50 /thorn put dup 8#51 /brokenbar put dup 8#52 /degree put dup 8#53 /divide put dup 8#54 /multiply put dup 8#55 /minus put dup 8#56 /onehalf put dup 8#57 /onequarter put dup 8#60 /threequarters put dup 8#101 /Aacute put dup 8#102 /Acircumflex put dup 8#103 /Adieresis put dup 8#104 /Agrave put dup 8#105 /Aring put dup 8#106 /Atilde put dup 8#107 /Ccedilla put dup 8#110 /Eacute put dup 8#111 /Ecircumflex put dup 8#112 /Edieresis put dup 8#113 /Egrave put dup 8#114 /Iacute put dup 8#115 /Icircumflex put dup 8#116 /Idieresis put dup 8#117 /Igrave put dup 8#120 /Ntilde put dup 8#121 /Oacute put dup 8#122 /Ocircumflex put dup 8#123 /Odieresis put dup 8#124 /Ograve put dup 8#125 /Otilde put dup 8#126 /Scaron put dup 8#127 /Uacute put dup 8#130 /Ucircumflex put dup 8#131 /Udieresis put dup 8#132 /Ugrave put dup 8#133 /Ydieresis put dup 8#134 /Zcaron put dup 8#135 /aacute put dup 8#136 /acircumflex put dup 8#137 /adieresis put dup 8#140 /agrave put dup 8#141 /aring put dup 8#142 /atilde put dup 8#143 /ccedilla put dup 8#144 /eacute put dup 8#145 /ecircumflex put dup 8#146 /edieresis put dup 8#147 /egrave put dup 8#150 /iacute put dup 8#151 /icircumflex put dup 8#152 /idieresis put dup 8#153 /igrave put dup 8#154 /ntilde put dup 8#155 /oacute put dup 8#156 /ocircumflex put dup 8#157 /odieresis put dup 8#160 /ograve put dup 8#161 /otilde put dup 8#162 /scaron put dup 8#163 /uacute put dup 8#164 /ucircumflex put dup 8#165 /udieresis put dup 8#166 /ugrave put dup 8#167 /ydieresis put dup 8#170 /zcaron put pop /Enc-dict 30 dict def Enc-dict /tmpstr1 50 string put Enc-dict /tmpstr2 50 string put Enc-dict /tmpstr3 50 string dup (Encoding-) exch cvs pop put /AEnc-def { % arguments: the original font's name, encoding nr Enc-dict begin tmpstr2 cvs /Enc-no exch def % Remember the number in a string dup /OrigName exch def % remember the name findfont dup maxlength dict /newdict exch def % get dictionary for new font { exch dup /FID ne { exch newdict 3 1 roll put } { pop pop } % Ignore FID ifelse } forall newdict begin /Encoding tmpstr3 9 Enc-no putinterval tmpstr3 0 9 Enc-no length add getinterval cvn load def % Replace encoding currentdict /UniqueID known { /UniqueID UniqueID Enc-no cvi 49999 mul add def } if % Derive New UniqueID end % newdict /FNlength OrigName tmpstr1 cvs length def % convert name, remember length FNlength 1 add Enc-no length add string dup 0 OrigName tmpstr1 cvs putinterval dup FNlength (-) putinterval dup FNlength 1 add Enc-no putinterval dup 0 tmpstr1 0 FNlength getinterval putinterval % Add old name cvn dup newdict /FontName 3 2 roll put newdict definefont end % Enc-dict } def /Times-Roman 1 AEnc-def pop /R-1{/Times-Roman-1 FF}def /R{/Times-Roman FF}def /B{/Times-Bold FF}def /I{/Times-Italic FF}def %%EndProlog %%Page: 1 1 BP /slant 0 def /height 0 def 480 V 10 R 720(MALLOC)S 1154(\()S 1196(3)S 1254(\))S 2696(Eighth)S (Edition)296 2989 A 4693(MALLOC)S 5127(\()S 5169(3)S 5227(\))S 960 V 9 R 720(N)S 722(NA)S 790(AM)S 858(ME)S 940(E)S 1080 V 10 R 1080(malloc,)S 1404(free,)S 1612(realloc,)S 1937(calloc,)S 2228(alloca)S 10 R-1 2494(-)S 10 R 2576(memory)S 2936(allocator)S 1248 V 9 R 720(S)S 722(SY)S 774(YN)S 842(NO)S 910(OP)S 978(PS)S 1030(SI)S 1082(IS)S 1115(S)S 1368 V 10 B 1080(#include)S 1482()S 1488 V 1080(#include)S 1482()S 1608 V 1080(#include)S 1482()S 1848 V 1080(void)S 1302(*malloc\(size_t)S 10 I 1950(size)S 10 B 2101(\))S 1968 V 1080(void)S (free\(void)387 1302 A 1727(*)S 10 I 1777(ptr)S 10 B 1894(\))S 2088 V 1080(void)S 1302(*realloc\(void)S 1899(*)S 10 I 1949(ptr)S 10 B 2066(,)S 2129(size_t)S 10 I 2408(size)S 10 B 2559(\))S 2208 V 1080(void)S 1302(*calloc\(size_t)S 10 I 1911(nelem)S 10 B 2152(,)S 2215(size_t)S 10 I 2494(elsize)S 10 B 2718(\))S 2328 V 1080(void)S 1302(*alloca\(size_t)S 10 I 1916(size)S 10 B 2067(\))S 2496 V 9 R 720(D)S 722(DE)S 790(ES)S 848(SC)S 900(CR)S 962(RI)S 1024(IP)S 1057(PT)S 1109(TI)S 1167(IO)S 1200(ON)S 1268(N)S 2616 V 10 B 1080(Malloc)S 10 R 1406(and)S 10 B (free)169 1581 A 10 R 1780(provide)S 2117(a)S 2192(general-purpose)S 2872(memory)S 3238(allocation)S 3666(package.)S 10 B 4077(Malloc)S 10 R 4404(returns)S 4715(a)S 4791(pointer)S 5107(to)S 5216(a)S 2736 V 1080(block)S 1328(of)S 1437(at)S 1535(least)S 10 I 1745(size)S 10 R 1921(bytes)S 2158(beginning)S 2584(on)S 2709(a)S 2779(word)S (boundary.)404 3011 A 2904 V 1080(The)S 1268(argument)S 1679(to)S 10 B (free)169 1788 A 10 R 1988(is)S 2086(a)S 2162(pointer)S 2478(to)S 2588(a)S 2665(block)S 2920(previously)S 3376(allocated)S 3772(by)S 10 B 3904(malloc)S 10 R 4189(;)S 4249(this)S (space)224 4426 A 4682(is)S 4781(made)S 5031(avail-)S 3024 V 1080(able)S 1277(for)S 1424(further)S 1728(allocation,)S 2179(but)S 2336(its)S 2460(contents)S 2824(are)S 2977(left)S (undisturbed.)499 3141 A 3694(A)S 3796(call)S 3971(with)S 4179(a)S 4253(null)S 10 I 4438(ptr)S 10 R 4584(is)S 4680(legal)S 4904(and)S 5077(does)S 3144 V 1080(nothing.)S 3312 V 1080(Needless)S 1469(to)S 1572(say,)S 1756(grave)S 2005(disorder)S (will)157 2360 A 2542(result)S 2791(if)S 2878(the)S (space)224 3027 A 3277(assigned)S 3649(by)S 10 B 3775(malloc)S 10 R 4086(is)S 4179(overrun)S 4518(or)S 4628(if)S 4716(some)S (random)307 4954 A 3432 V 1080(number)S 1412(is)S 1504(handed)S 1819(to)S 10 B (free)169 1922 A 10 R 2091(.)S 3600 V 10 B 1080(Malloc)S 10 R 1407(maintains)S (multiple)335 1829 A 2195(lists)S 2388(of)S 2503(free)S 2692(blocks)S (according)397 2985 A 3413(to)S 3522(size,)S 3735(allocating)S (space)224 4163 A 4419(from)S 4647(the)S 4802(appropriate)S 3720 V 1080(list.)S 1288(It)S 1385(calls)S 10 B 1605(sbrk)S 10 R 1836(\(see)S 10 B 2034(brk)S 10 R 2191(\(2\)\))S 2378(to)S 2491(get)S 2649(more)S 2891(memory)S 3261(from)S 3492(the)S 3650(system)S 3964(when)S 4217(there)S 4454(is)S 4556(no)S 4690(suitable)S (space)224 5037 A 3840 V 1080(already)S 1402(free.)S 4008 V 10 B 1080(Realloc)S 10 R 1427(changes)S 1779(the)S 1930(size)S 2115(of)S 2227(the)S 2378(block)S 2629(pointed)S 2958(to)S 3064(by)S 10 I 3192(ptr)S 10 R 3337(to)S 10 I 3443(size)S 10 R 3622(bytes)S 3862(and)S 4035(returns)S 4343(a)S 4416(pointer)S 4729(to)S 4835(the)S 4987(\(possi-)S 4128 V 1080(bly)S 1243(moved\))S 1585(block.)S 1893(The)S 2085(contents)S (will)157 2454 A 2645(be)S 2774(unchanged)S 3243(up)S 3377(to)S 3489(the)S 3646(lesser)S 3910(of)S 4028(the)S 4185(new)S 4387(and)S 4566(old)S 4728(sizes.)S 5008(A)S 5115(call)S 4248 V 1080(with)S 1284(a)S 1354(null)S 10 I 1535(ptr)S 10 R 1677(is)S 1769(legal)S 1990(and)S 2160(has)S 2319(the)S 2467(same)S 2699(result)S 2948(as)S 10 B 3057(malloc\()S 10 I 3376(size)S 10 B 3535(\))S 10 R 3569(.)S 4416 V 10 B 1080(Calloc)S 10 R 1379(allocates)S (space)224 1757 A 2006(for)S 2149(an)S 2269(array)S 2502(of)S 10 I 2611(nelem)S 10 R 2877(elements)S 3260(of)S 3369(size)S 10 I 3551(elsize.)S 10 R 3825(The)S (space)224 4007 A 4256(is)S (initialized)403 4348 A 4776(to)S 4879(zeros.)S 4584 V 10 B 1080(Alloca)S 10 R 1382(allocates)S 10 I 1763(size)S 10 R 1942(bytes)S 2182(of)S (space)224 2294 A 2546(in)S 2653(the)S 2805(stack)S 3041(frame)S 3306(of)S 3419(the)S 3571(caller.)S 3875(This)S 4083(temporary)S (space)224 4526 A 4779(is)S 4875(automati-)S 4704 V 1080(cally)S 1301(freed)S 1534(on)S 1659(return.)S 4872 V 1080(Each)S 1314(of)S 1430(the)S 1585(allocation)S 2014(routines)S 2370(returns)S 2682(a)S 2759(pointer)S 3076(to)S (space)224 3186 A 3442(suitably)S 3792(aligned)S 4120(\(after)S 4373(possible)S 4735(pointer)S 5053(coer-)S 4992 V 1080(cion\))S 1312(for)S 1455(storage)S 1771(of)S 1880(any)S 2050(type)S 2248(of)S 2357(object.)S 5160 V 9 R 720(S)S 722(SE)S 774(EE)S 832(E)S 928(A)S 930(AL)S 998(LS)S 1056(SO)S 1108(O)S 5280 V 10 B 1080(brk)S 10 R 1237(\(2\).)S 5448 V 9 R 720(D)S 722(DI)S 790(IA)S 823(AG)S 891(GN)S 959(NO)S 1027(OS)S 1095(ST)S 1147(TI)S 1205(IC)S 1238(CS)S 1300(S)S 5568 V 10 B 1080(Malloc)S 10 R 1376(,)S 10 B 1427(realloc)S 10 R 1744(and)S 10 B 1915(calloc)S 10 R 2187(return)S 2455(a)S 2527(null)S 2710(pointer)S 3022(if)S 3111(there)S 3340(is)S 3434(no)S 3561(available)S 3952(memory)S 4314(or)S 4425(if)S 4514(the)S 4664(arena)S 4910(has)S 5071(been)S 5688 V 1080(detectably)S 1519(corrupted)S 1930(by)S 2055(storing)S 2359(outside)S 2674(the)S (bounds)289 2822 A 3136(of)S 3245(a)S 3315(block.)S 5856 V 9 R 720(N)S 722(NO)S 790(OT)S 858(TE)S 916(ES)S 974(S)S 5976 V 10 R 1080(Other)S 1335(implementations)S 2030(of)S 10 B 2139(malloc)S 10 R 2424(,)S 10 B 2474(realloc)S 10 R 2790(or)S 10 B 2899(calloc)S 10 R 3170(may)S 3368(return)S 3634(a)S 3704(null)S 3885(pointer)S 4196(if)S 4284(the)S 4433(size)S 4616(of)S 4726(the)S 4875(requested)S 6096 V 1080(block)S 1332(is)S 1428(zero.)S 1681(This)S 1889(implementation)S (will)157 2549 A 2735(always)S 3044(return)S 3314(a)S 3388(zero)S 3591(length)S 3871(block)S 4123(at)S 4225(a)S 4299(unique)S 4600(address,)S 4955(but)S (you)150 5111 A 6216 V (should)267 1080 A 1378(keep)S 1599(in)S 1708(mind)S 1945(that)S 2127(a)S 2203(null)S 2390(return)S 2662(is)S 2760(possible)S 3120(if)S 3213(the)S 3367(program)S 3739(is)S 3837(run)S 4002(to)S 4111(another)S 4445(system)S 4756(and)S 4933(that)S 5116(this)S 6336 V (should)267 1080 A 1372(not)S 1525(be)S 1645(mistakenly)S 2111(seen)S 2315(as)S 2424(an)S 2544(error.)S 6504 V 9 R 720(B)S 722(BU)S 784(UG)S 852(GS)S 920(S)S 6624 V 10 R 1080(When)S 10 B 1345(realloc)S 10 R 1661(returns)S 1966(a)S 2036(null)S 2217(pointer,)S 2552(the)S 2700(block)S 2948(pointed)S 3274(to)S 3377(by)S 10 I 3502(ptr)S 10 R 3644(may)S 3842(be)S 3962(destroyed.)S 6792 V 10 B 1080(Alloca)S 10 R 1379(is)S 1471(machine)S 1837(dependent;)S 2303(its)S 2423(use)S 2582(is)S 2674(discouraged.)S 7903 V 720(Page)S 941(1)S 2669(\()S 2711(May)S 2920(14,)S (1986)200 3070 A 3278(\))S 4455(September)S 4911(13,)S (1996)200 5061 A 8143 V EP %%Trailer %%DocumentFonts: Times-Roman Times-Bold Times-Italic %%Pages: 1