Re: how to handle memory ownership when interfacing with C/C++ via internal pointers

2013-10-15 Thread timotheecour
On Thursday, 10 October 2013 at 23:02:29 UTC, Timothee Cour wrote: Short version: I have a struct A* aptr allocated in C/C++ with an internal pointer aptr->ptr (say a double*) I want to store a reference x (say double[]) in D to aptr only through aptr->ptr, not through aptr directly as it's inco

how to handle memory ownership when interfacing with C/C++ via internal pointers

2013-10-10 Thread Timothee Cour
Short version: I have a struct A* aptr allocated in C/C++ with an internal pointer aptr->ptr (say a double*) I want to store a reference x (say double[]) in D to aptr only through aptr->ptr, not through aptr directly as it's inconvenient in my use case. How do I achieve that, so that when x goes o