[comp.sys.mac.programmer] NewPtr address error?

sdy@ssc-vax.UUCP (Steven D Yee) (03/21/88)

OK, its slow going with macsbug so I thought I'd ask for a hint.

I'm using LSC 2.15 on a 512e and I've been getting a bomb box (id=2) with
an address error from my call to NewPtr(). The address noted by macsbug was
410566 which it thinks is in MoreMasters() -- so I added more calls to
MoreMasters() prior to my intialization (for a total of 7 calls, as well as a
call to MaxAppZone()). but the error persists.

I tracked the error down into the NewPtr Atrap which has a valid input value of
0x30 and a call to FreeMem() just prior to this was showing plenty of room.
This is only the second call I'm making to NewPtr an they are relativly small
requests in that I'm just trying to create space for a copy of two character
bitmaps to use. (for the BitMap datatype). The only memory manager diddling
that I consiously do is to MoveHHi and Hlock then HUnlock the font record that
I want to copy the character from.

Any ideas what could be causing this bomb?

Oh I based my code on the miniedit example that comes with LSC so I think that
the windowing/maineventloop/menus are ok cuz I really didn't diddle with them
all that much -- I added hooks for my code in the appropriate places.

One other question I had was why when I use the Debugger() break sometimes when
I try to Trace or Single step I all of a sudden find myself in the PinRect
routine and I need to do a Go to continue to the next statement after the
breakpoint. is it getting some kind of interrupt that it has to handle first
before single stepping into my code??

steve
ps feel free to email if you don't want to post.



-- 
Steven D. Yee                 >>> my employer does not share my opinions  <<<
uw-beaver!ssc-vax!sdy         >>> (that's because I'm always right! ;-)   <<<

(chant) We want more!  We want more!  We want more lines than four!!!!!!!

sdy@ssc-vax.UUCP ("Sukebe") (03/22/88)

In article <1030@ssc-bee.ssc-vax.UUCP>, sdy@ssc-vax.UUCP (Steven D Yee) writes:
> OK, its slow going with macsbug so I thought I'd ask for a hint.
> 
ok, I found that I inverted some indices which caused an earlier (quite a bit
earlier) call to copybits() to corrupt the heap -- something I didn't
notice until figured out why I was getting the same address error when I used
the HD command of macsbug.The HC command and traping the debugger earlier
verified the problem -- so it only took me 2.5 days -- at this rate I may
finish by 1989.


-- 
Steven D. Yee                 >>> my employer does not share my opinions  <<<
uw-beaver!ssc-vax!sdy         >>> (that's because I'm always right! ;-)   <<<

(chant) We want more!  We want more!  We want more lines than four!!!!!!!