home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / sys / mac / programm / 20530 < prev    next >
Encoding:
Internet Message Format  |  1993-01-02  |  1.6 KB

  1. Path: sparky!uunet!cs.utexas.edu!torn!utzoo!telly!problem!magicbb!jacman
  2. Message-ID: <1993Jan01.204637.395327@magicbb.uucp>
  3. Newsgroups: comp.sys.mac.programmer
  4. Distribution: world
  5. From: jacman@magicbb.uucp (Jordan Christensen)
  6. Organization: MAGIC - Macintosh Awareness Group In Canada
  7. Date: Fri, 01 Jan 1993 20:46:37 EST
  8. Subject: Re: "DisposePtr" routine in THINK Pascal
  9. Lines: 36
  10.  
  11. > Hello,
  12. > I figured out very strange thing in THINK Pascal 4.0.1:
  13. > I've placed one fragment from my program:
  14. > var
  15. >     AppPtr: IntegerPtr;
  16. > begin                                    #debugger info: address of AppPtr is 000000000
  17. >  AppPtr := IntegerPtr(NewPtrClear(2));    #debugger info: address of AppPtr
  18. > is 0001D23A2 (OK)
  19. >  AppPtr^ := 327;                        #debugger info: address of AppPtr is 0001D23A2 (OK)
  20. >  SetPtrSize(Ptr(AppPtr), 4);            #debugger info: address of AppPtr is
  21. > 0001D23A2 (OK)
  22. >  DisposePtr(Ptr(AppPtr));                #debugger info: address of AppPtr is
  23. > 0001D23A2 (OK)
  24. > end.                                    #debugger info: address of AppPtr is 0001D23A2 ?
  25. >         
  26. > I used standard THINK Pascal debugger..
  27. > Why, after calling *DisposePtr* my address is  0001D23A2 ?
  28. > It can't be! The address must be 000000000 here !!!!
  29. > What does it mean ? *DisposePtr* do nothing here? or smth else ?
  30. > I'm always care about "memory" in my programs! 
  31. > Therefore I CAN'T CONTINUE MY PROJECT! Please, if anyone know what I'm
  32. > doing
  33. > wrong, help!
  34. > Thank you!
  35. > Internet: dmitry@chemistry.chem.utah.edu.
  36. > = Dmitry =
  37.  
  38. Dimitry,
  39.     DisposePtr doesn't accutally clear the pointer, it just tells the memory
  40. manager that you don't need it any more, if you want it to equal 00000000
  41. then just set it to 'NIL'.
  42.  
  43. Jordan
  44. jacman@magicbb.uucp
  45.