Hi, i need to implement a life-time strategies in a c# project. i studied the code from Island source. make a skeleton like this:
public struct GdipObject: ILifetimeStrategy<GdipObject>{
private static IntPtr value;
public static void* New(void* aTTY, NativeInt aSize)
{
}
public static void Assign(ref GdipObject aDest, ref GdipObject aSource)
{
aDest = aSource;
}
public static void Copy(ref GdipObject aDest, ref GdipObject aSource)
{
aDest = aSource;
}
public static void Init(ref GdipObject Dest)
{
}
public static void Release(ref GdipObject Dest)
{
}
}
questions:
- what is aTTY point to by in the New method ? what is it use for? purpose ?
the document said: “that can hold the pointer for the maintained object.” i don’t understand, the pointer return from malloc isn’t the object ? why another pointer?
2.the size of the record is always suppose to be sizeof(Intptr)+aSize ?