[comp.sys.mac.programmer] Odd error on malloc

Ian_Clements@vos.stratus.com (Ian Clements) (06/29/91)

Organization: Stratus Computer

Can anybody point out whats going on here:

the MPW C 3.1 instruction is:

     linkPtr        a_link=NULL;
     a_link = (linkPtr)malloc(SIZE_OF_LINK_REC);

    'SIZE_OF_LINK_REC' = 8

I've already run through this code once and it was fine - other memory has 
been allocated all over the place but I'm pretty sure I'm not running out. 
And this is what I get in the SADE worksheet:


'"Internal malloc abort -- Corrupt segment in FreeList @ 757300E4"' at 
_badPtr+$0042 in "testbed"
_badPtr+$0042
          00CD044C  4CEE 1080 FEF8   *MOVEM.L    -$0108(A6),D7/A4


This is on a macII with 8 meg and rev 7.0 gold

Any ideas would be much appreciated.

Ian Clements



_____________________________________________________
Ian Clements
Stratus Computer
55 Fairbanks Blvd.
Marlboro, MA, 01752, USA

Ian_Clements@vos.stratus.com