Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!ames!uakari.primate.wisc.edu!aplcen!ginosko!brutus.cs.uiuc.edu!tut.cis.ohio-state.edu!pt.cs.cmu.edu!andrew.cmu.edu!nf0i+ From: nf0i+@andrew.cmu.edu (Norman William Franke, III) Newsgroups: comp.sys.mac.programmer Subject: LSC malloc() problems Message-ID: <0Z4co7e00WB5I4y0pY@andrew.cmu.edu> Date: 16 Sep 89 18:12:23 GMT Organization: Class of '92, Carnegie Mellon, Pittsburgh, PA Lines: 31 I'm porting an editor from a Unix machine to Think C 4.0, and I have run into a problem with malloc. The program seems to handle a number of malloc calls successfully (none are that large), but there is one it always dies on. I'm asking for about 25 bytes of space, and goes into an infinite loop. I renamed all the malloc calls something else, and loaded the source for malloc (that Think provided) and renamed it as well so I could see where it dies. It gets to this assembly sniplet: /* coalesce free blocks */ asm { moveq #0,d1 * @41 add.w d1,d0 * move.w 0(a0,d0.w),d1 * bpl.s @41 move.w d0,(a0) cmp.w size,d0 blo.s @31 ; block too small } And then repeats the "*"d lines forever. I don't understand this, does anyone know what's up? This is really annoying me... And on a semi-related note, I think Think C should have an option to let one set the integer size. Almost everything uses 32 bits ints, and some things depend on them... Thanks, nf0i+@andrew.cmu.edu Norman Franke