• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Catching signal errors
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Catching signal errors


  • Subject: Catching signal errors
  • From: Rick Steele <email@hidden>
  • Date: Sat, 5 Feb 2005 17:16:07 -0800


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:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Catching signal errors
      • From: Kevin Harris <email@hidden>
  • Prev by Date: Re: signal and dyld
  • Next by Date: ApplePanels and backlight values
  • Previous by thread: Re: signal and dyld
  • Next by thread: Re: Catching signal errors
  • Index(es):
    • Date
    • Thread