This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Patch to special_function_p


>>>>> Kaveh R Ghazi <ghazi@caip.rutgers.edu> writes:

 > Is even malloc safe?  What if I do:

 >> foo = malloc(10);
 >> [...]
 >> free(foo);
 >> [...]
 >> bar = malloc(10);

 > Isn't it possible that malloc returns the same address here?

 > (Or does the intervening call to free() block the aliasing
 > optimization?)

I believe that it does; any references to the old object are invalidated by
that call.

Jason

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]