Exemple #1
0
        private static Object Allocate(ref BumpAllocator profileData,
                                       VTable vtable,
                                       UIntPtr numBytes)
        {
            UIntPtr resultAddr =
                profileData.AllocateFast(numBytes, vtable.baseAlignment);
            Object result = Magic.fromAddress(resultAddr);

            result.REF_STATE = 1;
            result.vtable    = vtable;
            return(result);
        }
Exemple #2
0
        internal override UIntPtr AllocateObjectMemory(UIntPtr numBytes,
                                                       uint alignment,
                                                       Thread currentThread)
        {
            UIntPtr resultAddr =
                BumpAllocator.AllocateFast(currentThread, numBytes, alignment);

            if (resultAddr == UIntPtr.Zero)
            {
                resultAddr = AllocateObjectMemorySlow(numBytes, alignment,
                                                      currentThread);
            }

            VTable.Assert(resultAddr != UIntPtr.Zero);
            return(resultAddr);
        }