Except for arguments, which are probably ok. Or rather, no worse than other things that retrieve unstable C pointers. Arguments are needed for IO.File to read/write array buffers and typed arrays. Split off from bug 1061288, which isn't really done until this is fixed.
So I've come to this bug after seeing crashes with compacting GC where ctypes::ConvertToJS() accesses a CData pointer that points to relocated memory. After doing some digging it seems that OS.File.write|writeAtomic and AbstractFile.readTo|write convert typed arrays to C pointers, in the first case passing the pointer to a worker thread. I think I need to talk to you about how to address this.
Yes, I know how to get rid of this, but the first step kills AdBlock Plus, so we need to wait until the next release of ABP (November 11th) before landing it.
Created attachment 8516155 [details] [diff] [review] Restrict array buffer -> pointer conversions to argument passing
Created attachment 8516171 [details] [diff] [review] Avoid converting array buffers to pointers in OS.File
Created attachment 8545313 [details] [diff] [review] bug1080262-ctypes Disallow ctypes from converting array buffers and typed arrays to pointers, except when passed as arguments.