3 ms·
Thread local storage would let you store a snapshot for thread A until thread A itself re-invokes getenv. Other comments seem to imply this isn't what FreeBSD
by MaulingMonkey 10y ago
Thread local storage would let you store a snapshot for thread A until thread A itself re-invokes getenv.
Other comments seem to imply this isn't what FreeBSD is doing however.
- quotemstr 10y agoSo what if you call getenv twice? const char* foo = getenv("FOO"); const char* bar = getenv("BAR"); foo and bar should both be valid here. Sure, you could allocate an arbitrary amount of thread-local storage, but that's still a leak.
- MaulingMonkey 10y agoGuess there's a reason FreeBSD isn't doing it :D.