Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Catching signal errors




Forgive the ignorance but,

if one has a function like this within an application:


void SumFunction(){

Ptr pPtr = -1L; //create something that will obviously crash if deferenced
char pSomethingElse;
pSomethingElse = (*pPtr); // Causing the error
}


how would some one catch the signal that would inevitable occur so the app might be able to close down gracefully?

also does anyone know how to determine the size of a malloc'd object?

ie:
	void 		*pObj = malloc(sizeof(long));

	...

	long		pSizeOfPointer = GetPtrSize(pObj);


-- Best Wishes

Rick Steele
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/darwin-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.