public static void disableGC() throws VM_PragmaInline, VM_PragmaInterruptible  {                VM_Thread myThread = VM_Thread.getCurrentThread();    if (VM_Magic.getFramePointer().sub(STACK_SIZE_GCDISABLED).LT(myThread.stackLimit) && !myThread.hasNativeStackFrame()) { VM_Thread.resizeCurrentStack(myThread.stack.length + STACK_SIZE_GCDISABLED, null); }    VM_Processor.getCurrentProcessor().disableThreadSwitching();    if (VM.VerifyAssertions) { VM._assert(myThread.disallowAllocationsByThisThread == false); myThread.disallowAllocationsByThisThread = true; }
public static void disableGC() throws VM_PragmaInline, VM_PragmaInterruptible { disableGC(false);
  public static void disableGC() throws VM_PragmaInline, VM_PragmaInterruptible  {     // current (non-gc) thread is going to be holding raw addresses, therefore we must:    //    // 1. make sure we have enough stack space to run until gc is re-enabled    //    (otherwise we might trigger a stack reallocation)    //    (We can't resize the stack if there's a native frame, so don't    //     do it and hope for the best)    //    // 2. force all other threads that need gc to wait until this thread    //    is done with the raw addresses    //    // 3. ensure that this thread doesn't try to allocate any objects    //    (because an allocation attempt might trigger a collection that    //    would invalidate the addresses we're holding)    //    VM_Thread myThread = VM_Thread.getCurrentThread();    // 1.    //    if (VM_Magic.getFramePointer().sub(STACK_SIZE_GCDISABLED).LT(myThread.stackLimit) && !myThread.hasNativeStackFrame()) {      VM_Thread.resizeCurrentStack(myThread.stack.length + STACK_SIZE_GCDISABLED, null);    }    // 2.    //    VM_Processor.getCurrentProcessor().disableThreadSwitching();    // 3.    //    if (VM.VerifyAssertions) {      VM._assert(myThread.disallowAllocationsByThisThread == false); // recursion not allowed      myThread.disallowAllocationsByThisThread = true;    }  }