optimize malloc to stack allocation.

Marc Glisse marc.glisse@inria.fr
Wed Jan 9 16:12:00 GMT 2013


On Wed, 9 Jan 2013, Ondøej Bílka wrote:

> gcc currently does not even optimize following fragment:
>
> int foo(){
>  char *x=malloc(64);
>  free(x);
> }

Yes it does.
(not that more optimizations aren't possible, but it does this one)

-- 
Marc Glisse



More information about the Gcc mailing list