This is the mail archive of the gcc@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]
Other format: [Raw text]

Re: Optimizing of explicit temporary storage


Mark Mitchell <mark@codesourcery.com> writes:
>>
>Yes, but that's rather a different situation due to the nature of Scheme.
>
>In C, even given just:
>
>  (void) malloc(16);
>
>it would be surprising to most programmers to optimize away the call 
>because malloc *does* have side-effects on real systems.  For example, 
>on UNIX, it is likely to call sbrk, which result in observable changes 
>in the process state.

Indeed! - I have actually written 

free(malloc(estimated_total_need));

To get expensive sbrk() call out of the way with one big one
rather than many smaller ones.


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