I've heard that some operating systems don't actually allocate malloc'ed memory until the program tries to use it. Is this legal?
It's hard to say. The Standard doesn't say that systems can act this way, but it doesn't explicitly say that they can't, either.
References:
ANSI Sec. 4.10.3
ISO Sec. 7.10.3
Read sequentially: prev next up top
This page by Steve Summit // Copyright 1995 // mail feedback