Article View: de.comp.lang.c
Article #5Re: Where does my thread-local data live ?
From: Chris M. Thomasson
Date: Sun, 15 Nov 2026 20:40
Date: Sun, 15 Nov 2026 20:40
23 lines
2207 bytes
2207 bytes
On 11/14/2026 10:35 AM, Bonita Montero wrote:
> #include <Windows.h>
> #include <iostream>
>
> using namespace std;
>
> int main()
> {
> thread_local int i;
> MEMORY_BASIC_INFORMATION mbi;
> if( !VirtualQueryEx( GetCurrentProcess(), &i, &mbi, sizeof mbi ) )
> return EXIT_FAILURE;
> cout << "allocation base: " << (void *)mbi.AllocationBase << endl;
> cout << "region base: " << (void *)mbi.BaseAddress << endl;
> cout << "&i: " << (void *)&i << endl;
> cout << "region size: " << (double)mbi.RegionSize / 0x1.0p12;
> cout << " pages" << endl;
> }
iirc, in the .tdata or .tss. But that might be for ELF. For Windows,
damn... iirc, in the TIB?
https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-tlsalloc
Technical Details
Message-ID:
<11dd5co$32h74$1@dont-email.me>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.hispagatos.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mailReferences:
<11da9lq$25qpm$3@raubtier-asyl.eternal-september.org>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.hispagatos.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail From: "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> Newsgroups: comp.lang.c++,de.comp.lang.c Subject: Re: Where does my thread-local data live ? Date: Sun, 15 Nov 2026 12:40:52 -0800 Organization: A noiseless patient Spider Lines: 23 Message-ID: <11dd5co$32h74$1@dont-email.me> References: <11da9lq$25qpm$3@raubtier-asyl.eternal-september.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Sun, 15 Nov 2026 20:40:56 +0000 (UTC) Injection-Info: dont-email.me; logging-data="3228900"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX190QPneB6d+EBJD1sPCD7wFhFxzfJXFsfg="; posting-host="8d4bfe82b7f7bce740ab6d5ca121f681" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:tL8dbl4SVcn8EyKZhuyvqM1bBjg= sha256:4V8xP79odBIrkpkoNQ2iTCmXc435JHpaVbybWM1fcEU= sha1:j/SkRbxK5U6ZBoxXmb6emDHp3U0= sha256:vlLtFJE6W5GGybVLVQscS5ZS1CrqJHEsCckZtCGKMSY= Content-Language: en-US In-Reply-To: <11da9lq$25qpm$3@raubtier-asyl.eternal-september.org>