home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / sys / mac / programm / 13114 < prev    next >
Encoding:
Text File  |  1992-07-28  |  1.7 KB  |  49 lines

  1. Newsgroups: comp.sys.mac.programmer
  2. Path: sparky!uunet!elroy.jpl.nasa.gov!ames!kronos.arc.nasa.gov!joshr
  3. From: joshr@kronos.arc.nasa.gov (Joshua Rabinowitz-Summer-91)
  4. Subject: thinkc5 DIRECT classes
  5. Message-ID: <1992Jul28.215321.18801@kronos.arc.nasa.gov>
  6. Summary: making CObject DIRECT
  7. Keywords: thinkc CObject direct
  8. Sender: usenet@kronos.arc.nasa.gov (Will Edgington, wedgingt@ptolemy.arc.nasa.gov)
  9. Nntp-Posting-Host: kronos-arclan.arc.nasa.gov
  10. Organization: NASA/ARC Information Sciences Division
  11. Distribution: comp.sys.mac.programmer
  12. Date: Tue, 28 Jul 1992 21:53:21 GMT
  13. Lines: 34
  14.  
  15. Hey fellow netters:
  16.  
  17. this may be a FAQ, but I doubt it. Iv'e seen little reference to the subject
  18. anywhere.
  19.  
  20. What I'm looking into is re-writing the CObject class as a direct, that
  21. is, not a handle but a reference.  My original thinking is that
  22. if I rewrote new() and delete() to call NewPtr() and DisposPtr(), and
  23. recompiled, all the objects would then be direct.
  24.  
  25. This should speed up some operations, because the constant double-
  26. dereferencing would be eliminated.  Of course it presents
  27. mem. fragmentation problems, but this may not be a problem.
  28.  
  29. When I tried it once, CopyObject was the problem:
  30. you cannot tkae sizeof(this), so one way to figure out the size of
  31. the object to be copied is GetPtr/HandleSize().
  32.  
  33. When I implemented this, the starter project crashed, and hard.  Complete
  34. lockup.
  35.  
  36. Has anyone tried this? aAre there other reasons to avoid it?
  37.  
  38. Your thoughts and comments are welcome.
  39.  
  40. joshr@kronos.arc.nasa.gov
  41.  
  42.  
  43.  
  44. -- 
  45. ----------------------------------
  46. #include <std/disclaimer.h>     Josh Rabinowitz, Mac TCL programmer
  47. joshr@kronos.arc.nasa.gov
  48. "'I see', said the blind carpenter, as he picked up his hammer and saw".
  49.