purity question

Stefan Koch via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun May 28 18:09:07 PDT 2017


On Monday, 29 May 2017 at 01:01:46 UTC, Stefan Koch wrote:
>
> There is
>
void[] myPureMalloc(uint size) pure @trusted nothrow @nogc
{
    import core.stdc.stdlib : malloc;
    alias pure_malloc_t = @nogc pure nothrow void* function(size_t 
size);
    return (cast(pure_malloc_t)&malloc)(size)[0 .. size];
}

This is the fixed version.


More information about the Digitalmars-d-learn mailing list