Re: malloc in obj-c/cocoa
Re: malloc in obj-c/cocoa
- Subject: Re: malloc in obj-c/cocoa
- From: Ben Dougall <email@hidden>
- Date: Fri, 6 Feb 2004 23:47:29 +0000
On Friday, February 6, 2004, at 11:33 pm, Jens Bauer wrote:
Hi Ben,
On Friday, Feb 6, 2004, at 22:14 Europe/Copenhagen, Ben Dougall wrote:
i'm malloc'ing little bits of memory, passing the pointers round and
stuff. getting this error:
*** malloc[22753]: error for object 0x7dbd0: Incorrect checksum for
freed object - object was probably modified after being freed; break
at szone_error
I've seen this ever so often. It's a memory overwrite.
Try disabling your code...
PositionPtr posp;
posp = (PositionPtr) malloc( i ));
while( i >= 0 ) {
// *(posp + i) = *(Buffer + i);
i--;
}
and see if the crash occurs.
If it doesn't, you know that this *is* the place it happens.
yup, you're absolutely right. haven't quite worked out exactly what's
happening yet but should be able to now.
thanks very much.
ben.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.