Re: free()'ing restrict'ed pointers
- From: "christian.bau" <christian.bau@xxxxxxxxxxxxxxxxxx>
- Date: Thu, 31 Jul 2008 08:51:11 -0700 (PDT)
On Jul 31, 3:37 pm, Ben Bacarisse <ben.use...@xxxxxxxxx> wrote:
void *space = malloc(1);
void *restrict rp = space;
free(space); // are we modifying *rp? -- I don't know.
The "restrict" keyword allows to compiler to rearrange loads and
stores. So if you used int* instead of void* and an assignment to *rp
before the call to free (), the compiler could move the assignment
past the call to free () with bad consequences.
.
- Follow-Ups:
- Re: free()'ing restrict'ed pointers
- From: Ajay
- Re: free()'ing restrict'ed pointers
- References:
- free()'ing restrict'ed pointers
- From: s0suk3
- Re: free()'ing restrict'ed pointers
- From: Ben Bacarisse
- free()'ing restrict'ed pointers
- Prev by Date: Re: free()'ing restrict'ed pointers
- Next by Date: Re: x % y = ( x -(x/y) * y)
- Previous by thread: Re: free()'ing restrict'ed pointers
- Next by thread: Re: free()'ing restrict'ed pointers
- Index(es):
Relevant Pages
|