Re: Best Way to Create String Variables in Assembly




Robert Redelmeier wrote:
>
> Yes, brk() requires a LIFO usage. This doesn't suit all
> apps, particularly not multi-threaded. Personally, I prefer
> to layout .bss with everything that might ever be required.
> On a CoW system, it doesn't cost anything until used.
>

BSS works great if your maximum memory allocation needs are
deterministic and you can calculate them prior to compilation.

And there is a *tiny* cost to grossly overallocating in the BSS section
- the OS still has to set up the page tables and the system consumes
*real* memory for those entries. Though this is such a ridiculously
small cost that it probably isn't worth mentioning.

Cheers,
Randy Hyde

.