G
guy1976
Hi
I have an object :
[Serializable]
public class Buffer
{
private int length;
private IntPtr buffer;
}
The buffer field is allocated from an unmanaged memory (via a COM
object).
What I'd like to do, is to serialize this object w/o needing to
convert the IntPtr to byte[] (in the GetObjectData method), the
reasons are :
1. To ease on the GC (reduce allocations/sec and induced GC/sec )
2. buffer can be very large (128KB)
3. Reduce Marshal.Copy
Any idea how?
I was thinking on memory pool, but there is a constrain that this
object is transfered via remoting, and I cannot waist b/w for sending
un-used data.
Thanks
Guy.
I have an object :
[Serializable]
public class Buffer
{
private int length;
private IntPtr buffer;
}
The buffer field is allocated from an unmanaged memory (via a COM
object).
What I'd like to do, is to serialize this object w/o needing to
convert the IntPtr to byte[] (in the GetObjectData method), the
reasons are :
1. To ease on the GC (reduce allocations/sec and induced GC/sec )
2. buffer can be very large (128KB)
3. Reduce Marshal.Copy
Any idea how?
I was thinking on memory pool, but there is a constrain that this
object is transfered via remoting, and I cannot waist b/w for sending
un-used data.
Thanks
Guy.