[Issue 9099] core.atomic.atomicLoad() cannot handle non-POD structs

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Dec 27 04:39:40 PST 2012


http://d.puremagic.com/issues/show_bug.cgi?id=9099


Dmitry Olshansky <dmitry.olsh at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dmitry.olsh at gmail.com


--- Comment #4 from Dmitry Olshansky <dmitry.olsh at gmail.com> 2012-12-27 04:39:38 PST ---
(In reply to comment #2)
> The problem is that atomicLoad() only works with POD (Plain Old Data) types.
> Structs with constructors are not POD. 

It used to work.

> Non-POD structs are returned with a
> different calling convention than POD, hence the crash.
> 
Then the definition of POD changed?
And besides what's the difference for the atomic load? AFAICT in D all structs
are PODs unless there is a postblit. There is no virtual table nor inheritance.
Even C++11 extends POD definition to include member functions. Why should we go
the opposite direction?

> The fix is for atomicLoad() to reject attempts to instantiate it with non-POD
> types.
> 

Even if there was a clear definition of it in D...

> The test case here should fail to compile.

... I expect atomicLoad to work with anything suitably sized w/o postblits and
opAssign.

-- 
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