I think the biggest advantage to this distinction would really be the cross-language API's, the GC can determine which pointers it owns, although I don't believe it currently exposes this capability.
On 4/17/14, Manu via Digitalmars-d <[email protected]> wrote: > On 17 April 2014 18:20, Kagamin via Digitalmars-d < > [email protected]> wrote: > >> You can do anything, what fits your task, see RefCounted and Unique for >> an >> example on how to write smart pointers. >> > > ... what? > > I don't think you understood my post. > > void f(void* ptr) > { > // was ptr allocated with malloc, or new? > } > > If we knew this, we may be able to address some problems with designing > better GC's, or cross-language API's. >
