Am Mittwoch, dem 22. Nov 2017 schrieb Tom Ehlert:

> > Are there any documented limits for environment variables in DOS?
> no.
> 
> > My implementation uses a static buffer. So the content changes with
> > every call to getenv. This is explicitly allowed by the standard.
> 
> > I don't want to make the buffer too large though,
> 
> did you ever hear about dynamic malloc()ated memory?

Of course, but that wouldn't work here.
It's meant to be compatible to the standard, so that existing software
doesn't have to be changed.

If I would malloc each time, then existing programs would need to free
the memory. You see, memory availability is small in the small model.

The only thing that could work is realloc the same space each and
every time. But that would be slow...

-- 
AKFoerster <https://AKFoerster.de/>

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Freedos-devel mailing list
Freedos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-devel

Reply via email to