home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!cs.utexas.edu!torn!utzoo!telly!problem!magicbb!jacman
- Message-ID: <1993Jan01.204637.395327@magicbb.uucp>
- Newsgroups: comp.sys.mac.programmer
- Distribution: world
- From: jacman@magicbb.uucp (Jordan Christensen)
- Organization: MAGIC - Macintosh Awareness Group In Canada
- Date: Fri, 01 Jan 1993 20:46:37 EST
- Subject: Re: "DisposePtr" routine in THINK Pascal
- Lines: 36
-
- > Hello,
- > I figured out very strange thing in THINK Pascal 4.0.1:
- > I've placed one fragment from my program:
- > var
- > AppPtr: IntegerPtr;
- > begin #debugger info: address of AppPtr is 000000000
- > AppPtr := IntegerPtr(NewPtrClear(2)); #debugger info: address of AppPtr
- > is 0001D23A2 (OK)
- > AppPtr^ := 327; #debugger info: address of AppPtr is 0001D23A2 (OK)
- > SetPtrSize(Ptr(AppPtr), 4); #debugger info: address of AppPtr is
- > 0001D23A2 (OK)
- >
- > DisposePtr(Ptr(AppPtr)); #debugger info: address of AppPtr is
- > 0001D23A2 (OK)
- > end. #debugger info: address of AppPtr is 0001D23A2 ?
- >
- > I used standard THINK Pascal debugger..
- >
- > Why, after calling *DisposePtr* my address is 0001D23A2 ?
- > It can't be! The address must be 000000000 here !!!!
- > What does it mean ? *DisposePtr* do nothing here? or smth else ?
- > I'm always care about "memory" in my programs!
- > Therefore I CAN'T CONTINUE MY PROJECT! Please, if anyone know what I'm
- > doing
- > wrong, help!
- > Thank you!
- > Internet: dmitry@chemistry.chem.utah.edu.
- > = Dmitry =
-
- Dimitry,
- DisposePtr doesn't accutally clear the pointer, it just tells the memory
- manager that you don't need it any more, if you want it to equal 00000000
- then just set it to 'NIL'.
-
- Jordan
- jacman@magicbb.uucp
-