On 2/24/2015 6:56 AM, Steven Schveighoffer wrote:
Actually, RCArray can never be allocated on GC, or you may corrupt memory. count
may be non-null, and point at invalid memory when the dtor is called.

Just set count to null after the delete.

Only safe way to do this is to C malloc/free the count. And yes, at that point,
you need atomics.

No, RCArray is not intended for shared access between threads.

Shared containers and local containers are different enough that they merit being different types with different implementations altogether. Trying to just slap 'shared' on a container isn't going to work.

Reply via email to