[Mono-dev] OracleClient.Oci and GC
Miguel de Icaza
miguel at xamarin.com
Thu Aug 21 23:27:47 UTC 2014
What makes a short ref suitable to be moved during GC?
I am confused, I thought we wouldn't do that.
On Thu, Aug 21, 2014 at 6:58 PM, Neale Ferguson <NealeFerguson at verizon.net>
> I've been looking at OciDefineHandle and the OciDefineByPos call it uses
> in particular. Currently two of the parameters passed to this call are
> short variables. They are passed as "ref" fields as Oracle uses their
> address to put size and indicator data once the data is fetched. However,
> being defined as short means that they are eligible for being moved during
> garbage collection. Thus if that field is moved between the OciDefineByPos
> call and the fetch of the data then what Oracle is pointing to may no
> longer be variable. I'm thinking it may be better to define these fields as
> IntPtr and allocate them and retrieve their values via Marshal.ReadInt16.
> I'm currently testing these changes and so far I'm not getting the failures
> I had been encountering. If this is a valid analysis then the OciBindxxxx
> calls will also need attention as it uses a ref indp parameter as well -
> these appear to be used in OracleParameter.cs.
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Mono-devel-list