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: [email protected]
ReportedBy: [email protected]
--- Comment #0 from Martin Nowak <[email protected]> 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: -------