home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / sys / mac / programm / 18176 < prev    next >
Encoding:
Text File  |  1992-11-09  |  2.0 KB  |  44 lines

  1. Newsgroups: comp.sys.mac.programmer
  2. Path: sparky!uunet!noc.near.net!news.cs.brandeis.edu!news!phils
  3. From: phils@chaos.cs.brandeis.edu (Phil Shapiro)
  4. Subject: Re: Button() not callable from interrupt ?
  5. In-Reply-To: robert@wsooti11.info.win.tue.nl's message of 9 Nov 92 09: 36:42 GMT
  6. Message-ID: <PHILS.92Nov9094020@chaos.cs.brandeis.edu>
  7. Sender: news@news.cs.brandeis.edu (USENET News System)
  8. Organization: Symantec Corp.
  9. References: <ROBERT.92Nov9103642@wsooti11.info.win.tue.nl>
  10. Distribution: comp
  11. Date: Mon, 9 Nov 1992 14:40:20 GMT
  12. Lines: 30
  13.  
  14. >>>>> On 9 Nov 92 09:36:42 GMT, robert@wsooti11.info.win.tue.nl (Robert Lukassen) said:
  15.  
  16.  > I ran into a bit of trouble the other day when I tried to read the
  17.  > state of the mouse-button from an interrupt-routine. I know that
  18.  > the state of the mouse-button is represented by a single bit in
  19.  > some low-memory variable and this works well, but why does (the old
  20.  > version of) Inside Macintosh claims that Button() can move or purge
  21.  > memory. That is absolutely insane! A simple fetch of a low-memory
  22.  > variable can't trigger a memory move or memory purge. What are they
  23.  > doing that makes calling Button() so dangerous?
  24.  
  25. I ran into a similar situation with GetMouse(), which IM I also
  26. documents as moving memory. It turns out that the only time Button()
  27. and GetMouse() (as well as some others) move memory is when then
  28. all-but-dead Journaling Mechanism is enabled. (Supposedly it was
  29. reserved in System 7 for a revised version of MacroMaker, one of the
  30. few macro tools that actually used journaling. Thankfully, MacroMaker
  31. rests in peace...)
  32.  
  33. If you disassemble these routines, you'll find that they check
  34. JournalFlag at 0x8DE to see if journaling is currently enabled. A
  35. possible solution is to add a similar check to your own code and use a
  36. low mem global when necessary; it's probably simpler to always examine
  37. low memory directly.
  38.  
  39.     -phil
  40. --
  41.    Phil Shapiro                                   Software Engineer
  42.    Language Products Group                     Symantec Corporation
  43.            Internet: phils@cs.brandeis.edu
  44.