Exemple #1
0
        public void InitHeap()
        {
#if PROCESS_TRACE
            BasicConsole.WriteLine(" > Initialising process heap...");
            if (FOS_System.GC.State != null)
            {
                BasicConsole.WriteLine(" > !! GC State not null!");
            }
            else
            {
                BasicConsole.WriteLine(" > GC State null as expected.");
            }

            BasicConsole.WriteLine(" >> Creating heap lock...");
#endif
            HeapLock = new SpinLock();
#if PROCESS_TRACE
            BasicConsole.WriteLine(" >> Setting heap lock...");
#endif
            FOS_System.Heap.AccessLock = HeapLock;
#if PROCESS_TRACE
            BasicConsole.WriteLine(" >> Setting heap lock initialised...");
#endif
            FOS_System.Heap.AccessLockInitialised = true;
            
#if PROCESS_TRACE
            BasicConsole.WriteLine(" >> Creating new GC state...");
#endif
            TheGCState = new FOS_System.GCState();

            if ((uint)TheGCState.CleanupList == 0xFFFFFFFF)
            {
                BasicConsole.WriteLine(" !!! PANIC !!! ");
                BasicConsole.WriteLine(" GC.state.CleanupList is 0xFFFFFFFF NOT null!");
                BasicConsole.WriteLine(" !-!-!-!-!-!-! ");
            }
#if PROCESS_TRACE
            BasicConsole.WriteLine(" >> Creating new GC lock...");
#endif
            TheGCState.AccessLock = new SpinLock();
#if PROCESS_TRACE
            BasicConsole.WriteLine(" >> Setting GC lock initialised...");
#endif
            TheGCState.AccessLockInitialised = true;
#if PROCESS_TRACE
            BasicConsole.WriteLine(" >> Setting GC state...");
#endif
            FOS_System.GC.State = TheGCState;
#if PROCESS_TRACE
            BasicConsole.WriteLine(" >> Done.");
#endif
        }
Exemple #2
0
 public static void Load(HeapBlock* heapPtr, SpinLock heapLock)
 {
     fblock = heapPtr;
     AccessLock = heapLock;
     AccessLockInitialised = (AccessLock != null);
 }
Exemple #3
0
        static GC()
        {
            Heap.InitFixedHeap();

            ExceptionMethods.State = ExceptionMethods.DefaultState = (ExceptionState*)Heap.AllocZeroed((uint)sizeof(ExceptionState), "GC()");

            Enabled = true;

            Heap.HeapAccessLock = new SpinLock(-1);
            Heap.HeapAccessLockInitialised = true;

            GCAccessLock = new SpinLock(-1);
            GCAccessLockInitialised = true;
        }