Cannot make my shared PureMallocator callable in pure functions

rikki cattermole rikki at cattermole.co.nz
Sat Feb 17 12:35:00 UTC 2018


On 17/02/2018 12:33 PM, Nordlöw wrote:
> I'm struggling with making
> 
> https://github.com/nordlow/phobos-next/blob/master/src/pure_mallocator.d
> 
> callable in pure functions such as here
> 
> https://github.com/nordlow/phobos-next/blob/master/src/pure_mallocator.d#L84 
> 
> 
> Shouldn't a shared
> 
>      static shared PureMallocator instance;
> 
> make it possible to call
> 
>      PureMallocator.instance.allocate(16);
> 
> in pure functions?

pure means no globals. As in none :)


More information about the Digitalmars-d-learn mailing list