🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: de.comp.lang.c
Article #3

Re: Where does my thread-local data live ?

#3
From: Bonita Montero
Date: Sat, 14 Nov 2026 19:58
18 lines
2019 bytes
#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;
  }
Technical Details
Message-ID: <11daehm$27g7e$2@raubtier-asyl.eternal-september.org>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!news-fra.pugleaf.net!srl.newsdeef.eu!news.hispagatos.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!raubtier-asyl.eternal-september.org!.POSTED!not-for-mail
References: <11da9lq$25qpm$3@raubtier-asyl.eternal-september.org>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!news-fra.pugleaf.net!srl.newsdeef.eu!news.hispagatos.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!raubtier-asyl.eternal-september.org!.POSTED!not-for-mail
From: Bonita Montero <Bonita.Montero@gmail.com>
Newsgroups: de.comp.lang.c
Subject: Re: Where does my thread-local data live ?
Followup-To: comp.lang.c++
Date: Sat, 14 Nov 2026 20:58:46 +0100
Organization: A noiseless patient Spider
Lines: 18
Message-ID: <11daehm$27g7e$2@raubtier-asyl.eternal-september.org>
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: Sat, 14 Nov 2026 19:58:46 +0000 (UTC)
Injection-Info: raubtier-asyl.eternal-september.org;
	logging-data="2343150"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1+BngnyFty5F10tV17KdNxf/Q5/a5hn7w4="; posting-host="b046d9ab9aabe093fe32e531738c5106"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:8RSJxzzfGc4Kczh9+ht5dE2n7l4= sha256:3jSALxuDhEbw1qtTtSfvwxTsxFK60u7gUEhjtrh0+NA=
	sha1:PwyE3xU1tTAUYv/nN7bIpG9PzcA= sha256:PKOI6+eXtOcQibX74p23Q9IOo4XtM+Oo/dRXVVTjemk=
Content-Language: de-DE
In-Reply-To: <11da9lq$25qpm$3@raubtier-asyl.eternal-september.org>