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.

Reply via email to