Re: free()'ing restrict'ed pointers
- From: santosh <santosh.k83@xxxxxxxxx>
- Date: Thu, 31 Jul 2008 19:23:05 +0530
s0suk3@xxxxxxxxx wrote:
Hi,
A object to which there is a pointer that has been declared 'restrict'
is supposed to be accessed only through that pointer. So is it safe to
call free() with a restricted pointer?
Yes.
Does free() try to access what
in points to in some way?
It most certainly accesses it's argument, but whether it accesses the
storage pointed to is not specified. In any case after calling free the
pointer object is left in an indeterminate state, and the storage
pointed at is no longer available. So it shouldn't matter to you
whether free accesses the storage or not.
.
- Follow-Ups:
- Re: free()'ing restrict'ed pointers
- From: Greg Comeau
- Re: free()'ing restrict'ed pointers
- References:
- free()'ing restrict'ed pointers
- From: s0suk3
- free()'ing restrict'ed pointers
- Prev by Date: Re: Re: Procyon Library for Atmel AVR MCU - I²C problems
- Next by Date: Re: Doubt
- Previous by thread: free()'ing restrict'ed pointers
- Next by thread: Re: free()'ing restrict'ed pointers
- Index(es):
Relevant Pages
|