memory.track.c File Reference

#include "error.h"
#include "memory.h"
#include "shellhooks.h"

Include dependency graph for memory.track.c:

Go to the source code of this file.

Defines

#define safetycushionsize   0x2800

Functions

static boolean getsafetycushion (void)
static boolean safetycushionhook (long *ctbytesneeded)
static Handle getnewhandle (long ctbytes, boolean fltemp)
static boolean resizehandle (Handle hresize, long size)
boolean haveheapspace (long size)
boolean testheapspace (long size)
void lockhandle (Handle h)
void unlockhandle (Handle h)
boolean validhandle (Handle h)
boolean newhandle (long size, Handle *h)
boolean newemptyhandle (Handle *h)
void disposehandle (Handle h)
long gethandlesize (Handle h)
boolean sethandlesize (Handle h, long size)
boolean minhandlesize (Handle h, long size)
void moveleft (ptrvoid psource, ptrvoid pdest, long length)
void moveright (ptrvoid psource, ptrvoid pdest, long length)
void fillchar (ptrvoid pfill, long ctfill, char chfill)
void clearbytes (ptrvoid pclear, long ctclear)
void clearhandle (Handle hclear)
void movefromhandle (Handle h, ptrvoid pdest, long length)
boolean newclearhandle (long size, Handle *hreturned)
boolean newfilledhandle (ptrvoid pdata, long size, Handle *hreturned)
static long getidealchunksize (void)
boolean newgrowinghandle (long size, Handle *h)
boolean prepareforgrowing (Handle h)
boolean copyhandle (Handle horig, Handle *hcopy)
short comparehandles (Handle h1, Handle h2)
boolean equalhandles (Handle h1, Handle h2)
long searchhandle (Handle hsearch, Handle hpattern, long ixstart, long ixlimit)
boolean sethandlecontents (ptrvoid pdata, long ctset, Handle hset)
void texttostring (ptrvoid ptext, long ctchars, bigstring bs)
void texthandletostring (Handle htext, bigstring bs)
boolean newtexthandle (const bigstring bs, Handle *htext)
boolean insertinhandle (Handle hgrow, long ix, ptrvoid pdata, long ctgrow)
boolean inserthandleinhandle (Handle hinsert, Handle h, unsigned long ix)
boolean pullfromhandle (Handle hpull, long ixpull, long ctpull, ptrvoid pdata)
boolean enlargehandle (Handle hgrow, long ctgrow, ptrvoid newdata)
boolean mungehandle (Handle hmunge, long ixmunge, long ctmunge, ptrvoid pinsert, long ctinsert)
boolean pushstringhandle (const bigstring bs, Handle htext)
boolean pushtexthandle (const bigstring bs, Handle htext)
boolean newheapstring (const bigstring bs, hdlstring *hstring)
boolean setheapstring (const bigstring bs, hdlstring hstring)
boolean pushhandle (Handle hsource, Handle hdest)
boolean loadfromhandle (Handle hload, long *ixload, long ctload, ptrvoid pdata)
boolean loadfromhandletohandle (Handle hload, long *ixload, long ctload, boolean fltemp, Handle *hnew)
boolean loadhandleremains (long ix, Handle hsource, Handle *hdest)
boolean pushlongondiskhandle (long x, Handle hpush)
boolean loadlongfromdiskhandle (Handle hload, long *ixload, long *x)
boolean popfromhandle (Handle hpop, long ctpop, ptrvoid pdata)
boolean copyhandlecontents (Handle hsource, Handle hdest)
boolean concathandles (Handle h1, Handle h2, Handle *hmerged)
boolean mergehandles (Handle h1, Handle h2, Handle *hmerged)
boolean unmergehandles (Handle hmerged, Handle *hfirst, Handle *hsecond)
boolean newintarray (short ct, hdlintarray *harray)
boolean setintarray (hdlintarray harray, short ix, short val)
boolean getintarray (hdlintarray harray, short ix, short *val)
void fillintarray (hdlintarray harray, short val)
boolean initmemory (void)

Variables

static Handle hsafetycushion = nil
static boolean flholdsafetycushion = false


Define Documentation

#define safetycushionsize   0x2800
 

Definition at line 42 of file memory.track.c.


Function Documentation

void clearbytes ptrvoid  pclear,
long  ctclear
 

Definition at line 531 of file memory.track.c.

References fillchar().

Here is the call graph for this function:

void clearhandle Handle  hclear  ) 
 

Definition at line 541 of file memory.track.c.

References fillchar(), and gethandlesize().

Referenced by newclearhandle(), newhashtable(), scriptnewprocess(), and statscompute().

Here is the call graph for this function:

short comparehandles Handle  h1,
Handle  h2
 

Definition at line 873 of file memory.track.c.

References gethandlesize(), min, and sgn.

Referenced by equalhandles(), GTvalue(), LTvalue(), and mathfunctionvalue().

Here is the call graph for this function:

boolean concathandles Handle  h1,
Handle  h2,
Handle hmerged
 

Definition at line 1792 of file memory.track.c.

References gethandlesize(), getnewhandle(), memoryerror(), moveleft(), and nil.

Referenced by addvalue().

Here is the call graph for this function:

boolean copyhandle Handle  horig,
Handle hcopy
 

Definition at line 843 of file memory.track.c.

References gethandlesize(), getnewhandle(), memoryerror(), moveleft(), and nil.

Here is the call graph for this function:

boolean copyhandlecontents Handle  hsource,
Handle  hdest
 

Definition at line 1520 of file memory.track.c.

References gethandlesize(), moveleft(), and sethandlesize().

Referenced by cmdsavestring(), langdialogpaste(), opxmlgetheadlinetextfromatts(), opxmlgetonevalue(), and pictverbsetpicture().

Here is the call graph for this function:

void disposehandle Handle  h  ) 
 

Definition at line 392 of file memory.track.c.

References cttemphandles, DisposeHandle, MemError, memoryerror(), and nil.

Here is the call graph for this function:

boolean enlargehandle Handle  hgrow,
long  ctgrow,
ptrvoid  newdata
 

Definition at line 1132 of file memory.track.c.

References gethandlesize(), and insertinhandle().

Here is the call graph for this function:

boolean equalhandles Handle  h1,
Handle  h2
 

Definition at line 911 of file memory.track.c.

References comparehandles().

Here is the call graph for this function:

void fillchar ptrvoid  pfill,
long  ctfill,
char  chfill
 

Definition at line 510 of file memory.track.c.

References ct.

Referenced by clearbytes(), clearhandle(), and filledstring().

void fillintarray hdlintarray  harray,
short  val
 

Definition at line 2068 of file memory.track.c.

References gethandlesize().

Here is the call graph for this function:

long gethandlesize Handle  h  ) 
 

Definition at line 425 of file memory.track.c.

References GetHandleSize, and nil.

static long getidealchunksize void   )  [static]
 

Definition at line 686 of file memory.track.c.

boolean getintarray hdlintarray  harray,
short  ix,
short val
 

Definition at line 2060 of file memory.track.c.

static Handle getnewhandle long  ctbytes,
boolean  fltemp
[static]
 

Definition at line 141 of file memory.track.c.

References cttemphandles, flholdsafetycushion, getsafetycushion(), hsafetycushion, NewHandle, and nil.

Here is the call graph for this function:

static boolean getsafetycushion void   )  [static]
 

Definition at line 58 of file memory.track.c.

References hsafetycushion, NewHandle, nil, and safetycushionsize.

boolean haveheapspace long  size  ) 
 

Definition at line 274 of file memory.track.c.

References DisposeHandle, getnewhandle(), and nil.

Referenced by processscheduler(), and testheapspace().

Here is the call graph for this function:

boolean initmemory void   ) 
 

Definition at line 2094 of file memory.track.c.

References getsafetycushion(), safetycushionhook(), and shellpushmemoryhook().

Referenced by shellinitmemory().

Here is the call graph for this function:

boolean inserthandleinhandle Handle  hinsert,
Handle  h,
unsigned long  ix
 

Definition at line 1089 of file memory.track.c.

References gethandlesize(), moveleft(), moveright(), nil, and sethandlesize().

Here is the call graph for this function:

boolean insertinhandle Handle  hgrow,
long  ix,
ptrvoid  pdata,
long  ctgrow
 

Definition at line 1057 of file memory.track.c.

References clearbytes(), gethandlesize(), moveleft(), moveright(), nil, and sethandlesize().

Here is the call graph for this function:

boolean loadfromhandle Handle  hload,
long ixload,
long  ctload,
ptrvoid  pdata
 

Definition at line 1348 of file memory.track.c.

References gethandlesize(), and moveleft().

Here is the call graph for this function:

boolean loadfromhandletohandle Handle  hload,
long ixload,
long  ctload,
boolean  fltemp,
Handle hnew
 

Definition at line 1432 of file memory.track.c.

References disposehandle(), getnewhandle(), loadfromhandle(), memoryerror(), and nil.

Referenced by addHeaderToTable(), getnexttoken(), glossarypatcherverb(), grabnthfield(), hashunpackbinary(), hashunpackexternal(), hashunpackscalar(), issafemacro(), langunpackhandle(), loadhandleremains(), neutermacros(), nthfieldhandle(), opunpacklist(), pictunpack(), readhandlestreamfieldtohandle(), runoutlinedirectivesverb(), urlsplit(), webserverparsecookies(), webserverparseheaders(), webserverprocessfirstline(), and webserverreadrequest().

Here is the call graph for this function:

boolean loadhandleremains long  ix,
Handle  hsource,
Handle hdest
 

Definition at line 1472 of file memory.track.c.

References gethandlesize(), and loadfromhandletohandle().

Referenced by langipchandletrapverb(), menuverbmemoryunpack(), oplangtextvisit(), opverbmemoryunpack(), parseargsverb(), pictverbmemoryunpack(), tableverbmemoryunpack(), and wpverbmemoryunpack().

Here is the call graph for this function:

boolean loadlongfromdiskhandle Handle  hload,
long ixload,
long x
 

Definition at line 1494 of file memory.track.c.

References loadfromhandle().

Referenced by hashunpackbinary(), hashunpackexternal(), hashunpackscalar(), menuverbunpack(), opverbunpack(), pictverbunpack(), tableverbunpack(), and wpverbunpack().

Here is the call graph for this function:

void lockhandle Handle  h  ) 
 

Definition at line 316 of file memory.track.c.

References HLock.

boolean mergehandles Handle  h1,
Handle  h2,
Handle hmerged
 

Definition at line 1832 of file memory.track.c.

References disposehandle(), gethandlesize(), getnewhandle(), memoryerror(), moveleft(), moveright(), nil, and resizehandle().

Referenced by hashpacktable(), langpacktree(), mepackmenustructure(), and tablepacktable().

Here is the call graph for this function:

boolean minhandlesize Handle  h,
long  size
 

Definition at line 450 of file memory.track.c.

References gethandlesize(), and sethandlesize().

Here is the call graph for this function:

void movefromhandle Handle  h,
ptrvoid  pdest,
long  length
 

Definition at line 564 of file memory.track.c.

References moveleft(), and nil.

Here is the call graph for this function:

void moveleft ptrvoid  psource,
ptrvoid  pdest,
long  length
 

Definition at line 459 of file memory.track.c.

void moveright ptrvoid  psource,
ptrvoid  pdest,
long  length
 

Definition at line 481 of file memory.track.c.

boolean mungehandle Handle  hmunge,
long  ixmunge,
long  ctmunge,
ptrvoid  pinsert,
long  ctinsert
 

Definition at line 1168 of file memory.track.c.

References insertinhandle(), min, moveleft(), nil, pullfromhandle(), and sgn.

Referenced by opflatfind(), and tablesearchcellvalue().

Here is the call graph for this function:

boolean newclearhandle long  size,
Handle hreturned
 

Definition at line 632 of file memory.track.c.

References clearhandle(), getnewhandle(), memoryerror(), and nil.

Here is the call graph for this function:

boolean newemptyhandle Handle h  ) 
 

Definition at line 386 of file memory.track.c.

References newhandle().

Here is the call graph for this function:

boolean newfilledhandle ptrvoid  pdata,
long  size,
Handle hreturned
 

Definition at line 658 of file memory.track.c.

References getnewhandle(), memoryerror(), moveleft(), and nil.

Here is the call graph for this function:

boolean newgrowinghandle long  size,
Handle h
 

Definition at line 747 of file memory.track.c.

References getidealchunksize(), getnewhandle(), newhandle(), nil, and SetHandleSize.

Here is the call graph for this function:

boolean newhandle long  size,
Handle h
 

Definition at line 371 of file memory.track.c.

References getnewhandle(), memoryerror(), and nil.

Referenced by bytestohex(), dbcopy(), fifreadfile(), growhandlestream(), hashquicksort(), hextobytes(), initmenusystem(), initstack(), langfunctionvalue(), langunpacktreenode(), largefilebuffer(), newemptyhandle(), newgrowinghandle(), opgetlinetext(), rundirectivesverb(), setbinaryvalue(), stringfunctionvalue(), and winregread().

Here is the call graph for this function:

boolean newheapstring const bigstring  bs,
hdlstring hstring
 

Definition at line 1270 of file memory.track.c.

References newfilledhandle().

Here is the call graph for this function:

boolean newintarray short  ct,
hdlintarray harray
 

Definition at line 2027 of file memory.track.c.

References newclearhandle().

Here is the call graph for this function:

boolean newtexthandle const bigstring  bs,
Handle htext
 

Definition at line 1028 of file memory.track.c.

References getnewhandle(), memoryerror(), moveleft(), nil, and stringlength.

Here is the call graph for this function:

boolean popfromhandle Handle  hpop,
long  ctpop,
ptrvoid  pdata
 

Definition at line 1505 of file memory.track.c.

References gethandlesize(), moveleft(), nil, and sethandlesize().

Here is the call graph for this function:

boolean prepareforgrowing Handle  h  ) 
 

Definition at line 779 of file memory.track.c.

boolean pullfromhandle Handle  hpull,
long  ixpull,
long  ctpull,
ptrvoid  pdata
 

Definition at line 1109 of file memory.track.c.

References gethandlesize(), moveleft(), nil, and sethandlesize().

Referenced by binarytodesc(), coercebinaryval(), converttextencoding(), deleteinhandle(), getnexttoken(), getvalueedittext(), handlepopleadingchars(), handletrimwhitespace(), hashunpacktable(), htmlrundirective(), htmlrunmacro(), langipccoerceparam(), langipcpushparam(), langstriptextsyntax(), langunpacktreenode(), langunpackvalue(), mungehandle(), opunpacklist(), opxmlgetwindowexpansionstate(), parsedialoghandle(), pictverbsetpicture(), putresourceverb(), putscrapverb(), rundirectivesverb(), scriptcommentvisit(), setmenuitemcommandkey(), stringdeletevalue(), stripbinarytypeid(), subtractvalue(), tablegetscrapvalue(), tableverbpack(), utf16toansi(), utf8toansi(), webserverparsecookies(), webserverprocessfirstline(), winregdowrite(), winregpullhkeyfromtext(), and xmlconverttodisplayname().

Here is the call graph for this function:

boolean pushhandle Handle  hsource,
Handle  hdest
 

Definition at line 1327 of file memory.track.c.

References enlargehandle(), fl, gethandlesize(), HLock, HUnlock, and nil.

Referenced by addday(), addvalue(), decompilespecialtable(), decompilevisit(), getmonthurl(), langpacktreevisit(), menuverbmemorypack(), mepackscriptvisit(), oplangtextvisit(), oppacklist(), opverbmemorypack(), opverbpacktotext(), opxmlbuildtaggedstring(), opxmlpushhandleline(), opxmlpushoneattribute(), opxmlpushoutlinetext(), pictpack(), pictverbmemorypack(), pushhandleonhandle(), tableverbmemorypack(), webserverbuilderrorpagefromstrings(), wppack(), wpverbmemorypack(), wpverbpacktotext(), and xmlvaltostring().

Here is the call graph for this function:

boolean pushlongondiskhandle long  x,
Handle  hpush
 

Definition at line 1486 of file memory.track.c.

References enlargehandle().

Referenced by menuverbpack(), opverbpack(), pictverbpack(), and wpverbpack().

Here is the call graph for this function:

boolean pushstringhandle const bigstring  bs,
Handle  htext
 

Definition at line 1205 of file memory.track.c.

References enlargehandle().

Here is the call graph for this function:

boolean pushtexthandle const bigstring  bs,
Handle  htext
 

Definition at line 1218 of file memory.track.c.

References enlargehandle(), and stringlength.

Here is the call graph for this function:

static boolean resizehandle Handle  hresize,
long  size
[static]
 

Definition at line 187 of file memory.track.c.

References flholdsafetycushion, gethandlesize(), getsafetycushion(), hsafetycushion, MemError, nil, noErr, and SetHandleSize.

Here is the call graph for this function:

static boolean safetycushionhook long ctbytesneeded  )  [static]
 

Definition at line 67 of file memory.track.c.

References DisposeHandle, flholdsafetycushion, hsafetycushion, nil, and safetycushionsize.

long searchhandle Handle  hsearch,
Handle  hpattern,
long  ixstart,
long  ixlimit
 

Definition at line 922 of file memory.track.c.

References gethandlesize(), i, and min.

Referenced by fwsNetEventReadStreamUntil(), handlehassuffix(), stringcomparevalue(), stringfunctionvalue(), subtractvalue(), textcommentdelete(), textfindreplace(), and webserverreadrequest().

Here is the call graph for this function:

boolean sethandlecontents ptrvoid  pdata,
long  ctset,
Handle  hset
 

Definition at line 970 of file memory.track.c.

References moveleft(), and sethandlesize().

Here is the call graph for this function:

boolean sethandlesize Handle  h,
long  size
 

Definition at line 434 of file memory.track.c.

References memoryerror(), nil, and resizehandle().

Here is the call graph for this function:

boolean setheapstring const bigstring  bs,
hdlstring  hstring
 

Definition at line 1280 of file memory.track.c.

References sethandlecontents(), and stringlength.

Referenced by hashresolvevalue(), and shellsetwindowtitle().

Here is the call graph for this function:

boolean setintarray hdlintarray  harray,
short  ix,
short  val
 

Definition at line 2040 of file memory.track.c.

References minhandlesize().

Here is the call graph for this function:

boolean testheapspace long  size  ) 
 

Definition at line 299 of file memory.track.c.

References haveheapspace(), and memoryerror().

Here is the call graph for this function:

void texthandletostring Handle  htext,
bigstring  bs
 

Definition at line 994 of file memory.track.c.

References gethandlesize(), and texttostring().

Here is the call graph for this function:

void texttostring ptrvoid  ptext,
long  ctchars,
bigstring  bs
 

Definition at line 981 of file memory.track.c.

References lenbigstring, moveleft(), and setstringlength.

Referenced by addHeaderToTable(), fwsNetEventReadStream(), indexpage(), nthfield(), nthword(), readhandlestreamfield(), texthandletostring(), webserverparsecookies(), webserverprocessfirstline(), and xcmdcallback().

Here is the call graph for this function:

void unlockhandle Handle  h  ) 
 

Definition at line 322 of file memory.track.c.

References HUnlock.

boolean unmergehandles Handle  hmerged,
Handle hfirst,
Handle hsecond
 

Definition at line 1945 of file memory.track.c.

References disposehandle(), error, gethandlesize(), getnewhandle(), longswap, memoryerror(), moveleft(), nil, and sethandlesize().

Referenced by hashunpacktable(), langunpacktree(), meunpackmenustructure(), and tableunpacktable().

Here is the call graph for this function:

boolean validhandle Handle  h  ) 
 

Definition at line 328 of file memory.track.c.

References GetHandleSize, MemError, nil, and noErr.

Referenced by getaddresspath(), getaddressvalue(), pushtmpstack(), and pushtmpstackvalue().


Variable Documentation

boolean flholdsafetycushion = false [static]
 

Definition at line 55 of file memory.track.c.

Handle hsafetycushion = nil [static]
 

Definition at line 53 of file memory.track.c.


Generated on Wed Jun 7 08:02:41 2006 for frontierkernel 10.1.10a by  doxygen 1.4.6