[Issue 10108] New: Thread local slice to array literal references the same data
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Fri May 17 09:13:00 PDT 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10108
Summary: Thread local slice to array literal references the
same data
Product: D
Version: unspecified
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: code at dawg.eu
--- Comment #0 from Martin Nowak <code at dawg.eu> 2013-05-17 09:12:58 PDT ---
cat > bug.d << CODE
import core.thread;
int[] arr = [1,2,3];
__gshared int* thrPtr;
void main()
{
auto thr = new Thread({thrPtr = arr.ptr;});
thr.start();
thr.join();
assert(arr.ptr !is thrPtr);
}
CODE
----
Only the `arr` variable is store in TLS, but `arr.ptr` references the literal
which is in the shared data segment.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list