RE: A89: Re: when malloc fails...


[Prev][Next][Index][Thread]

RE: A89: Re: when malloc fails...




> TIOS won't exit() the program if a memory allocation fails
> (unless TIGCC has
> implemented it that way). Instead, you'll get a null pointer or
> handle returned
> from the function, so it's up to you to free all the memory
> you've allocated

That is correct, I just wanted to know If I had to free all allocated memory
"manually" on the calling level and up.

> In most cases you shouldn't have to use malloc() though.

What should have I used? (My program may require several bytes in one place,
and several kilobytes on another, or vice versa, and there is no way to
predict how much memory will be needed in compile time)

> In a related topic, does TIGCC support BSS blocks yet? Can the
> TIOS support it?

As far as I understand it, TIGCC does not support BSS blocks, because TIOS
doesn't.




Follow-Ups: References: