Re: Pointer Testing
Re: Pointer Testing
- Subject: Re: Pointer Testing
- From: Brian Bergstrand <email@hidden>
- Date: Sat, 15 Feb 2003 12:02:08 -0600
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Saturday, February 15, 2003, at 11:07 AM, Brent Marykuca wrote:
>
On Friday, February 14, 2003, at 10:00 PM, Jeff Jenkins wrote:
>
>
> I think you are asking a question that everyone who has ever used the
>
> C
>
> language would like to have a simple solution to. The answer is no,
>
> there is nothing inherent in the language that does this.
>
>
Yes, I know that C itself has nothing to help, but surely the
>
information is available to the kernel. The virtual memory system must
>
maintain tables of valid/invalid address ranges and read/write
>
permissions for every task, so it's not inconceivable that such an API
>
could be made available. Win32, for example, has routines called
>
IsBadReadPtr(), IsBadWritePtr(), IsBadCodePtr() and IsBadStringPtr()
>
that do this.
There are some functions in the Carbon framework on X that are similar
to these W32 functions. I think they are declared in Debugging.h. But,
I also think they only work with Carbon Ptr and Handle types. IOW, they
won't work with malloc'd memory.
AFAIK, there is nothing in kernel that you give you this info..
HTH.
Brian Bergstrand
<
http://www.classicalguitar.net/brian/> PGP Key ID: 0xB6C7B6A2
For every human problem, there is a neat, simple solution; and it is
always wrong - H. L. Mencken
-----BEGIN PGP SIGNATURE-----
Version: PGP 8.0
iQA/AwUBPk5yknnR2Fu2x7aiEQKbvQCgrQiS+ZIIJZjknAPxHRjMW0U9co4AmgND
qGSqi7jLYMCwOmBJEggOvzTC
=gn0k
-----END PGP SIGNATURE-----
_______________________________________________
darwin-kernel mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/darwin-kernel
Do not post admin requests to the list. They will be ignored.