Scott Meyers' DConf 2014 keynote "The Last Thing D Needs"
Jesse Phillips via Digitalmars-d-announce
digitalmars-d-announce at puremagic.com
Fri May 30 07:51:05 PDT 2014
On Friday, 30 May 2014 at 11:31:18 UTC, safety0ff wrote:
> On Friday, 30 May 2014 at 04:21:18 UTC, Jesse Phillips wrote:
>>
>> 1. http://he-the-great.livejournal.com/52333.html
>
> Note that in the following code:
> import core.memory : GC;
> int* pxprime = cast(int*)GC.malloc(int.sizeof);
> version(none) assert(pxprime); // possibly zero
>
> GC.malloc currently doesn't initialize the memory if NO_SCAN is
> specified as attribute.
I expect malloc to not initialize ever, that was the point.
Initialization can be done with calloc.
> Also, I don't understand why half of your asserts have
> version(none) (it's distracting.)
I can't guarantee the assert to pass, as the comment mentions it
is possibly zero, which would cause failure.
> Also note that you're not dereferencing pxprime, I'm not sure
> if its intentional.
Thanks, was intending to dereference.
Thank you for feedback.
More information about the Digitalmars-d-announce
mailing list