pure or not pure?
Janice Caron
caron800 at googlemail.com
Thu Apr 10 10:44:42 PDT 2008
On 10/04/2008, Janice Caron <caron800 at googlemail.com> wrote:
> On 10/04/2008, Koroskin Denis <2korden+dmd at gmail.com> wrote:
> > OK, new is 'special', but what about malloc or my own allocator? (I happen
> > to work in a gamedev and we never use new nor malloc).
> > I don't see how
> >
> > special extern(C) void* malloc(size_t size);
> >
> > differs from:
> >
> > void* my_malloc(size_t size)
> > {
> > return malloc(size);
> > }
Sorry, I should have added: /neither/ of those functions is pure.
In fact, I strongly doubt that any function declared extern(C) will be
pure, for the simple and obvious reason that C doesn't have the "pure"
keyword. :-)
More information about the Digitalmars-d
mailing list