VirtualBox

Changeset 2912 in kBuild for trunk/src/kWorker


Ignore:
Timestamp:
Sep 14, 2016 1:36:15 PM (8 years ago)
Author:
bird
Message:

rewrote kmk_redirect to skip the separate process. Added chache invalidation after directory deletion for addressing kmk rebuild and fetching.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kWorker/kWorker.c

    r2906 r2912  
    26382638static _onexit_t __cdecl kwSandbox_msvcrt__onexit(_onexit_t pfnFunc)
    26392639{
    2640     if (g_Sandbox.pTool->u.Sandboxed.enmHint == KWTOOLHINT_VISUAL_CPP_LINK)
     2640    //if (g_Sandbox.pTool->u.Sandboxed.enmHint == KWTOOLHINT_VISUAL_CPP_LINK)
    26412641    {
    26422642        PKWEXITCALLACK pCallback;
     
    26632663static int __cdecl kwSandbox_msvcrt_atexit(int (__cdecl *pfnFunc)(void))
    26642664{
    2665     if (g_Sandbox.pTool->u.Sandboxed.enmHint == KWTOOLHINT_VISUAL_CPP_LINK)
     2665    //if (g_Sandbox.pTool->u.Sandboxed.enmHint == KWTOOLHINT_VISUAL_CPP_LINK)
    26662666    {
    26672667        PKWEXITCALLACK pCallback;
     
    74927492    PKWEXITCALLACK              pExitCallback;
    74937493
     7494
     7495    /*
     7496     * First stuff that may cause code to run.
     7497     */
     7498
    74947499    /* Do exit callback first. */
    74957500    pExitCallback = g_Sandbox.pExitCallbackHead;
     
    75147519    }
    75157520
     7521    /* Free left behind FlsAlloc leaks. */
     7522    pLocalStorage = g_Sandbox.pFlsAllocHead;
     7523    g_Sandbox.pFlsAllocHead = NULL;
     7524    while (pLocalStorage)
     7525    {
     7526        PKWLOCALSTORAGE pNext = pLocalStorage->pNext;
     7527        KW_LOG(("Freeing leaked FlsAlloc index %#x\n", pLocalStorage->idx));
     7528        FlsFree(pLocalStorage->idx);
     7529        kHlpFree(pLocalStorage);
     7530        pLocalStorage = pNext;
     7531    }
     7532
     7533    /* Free left behind TlsAlloc leaks. */
     7534    pLocalStorage = g_Sandbox.pTlsAllocHead;
     7535    g_Sandbox.pTlsAllocHead = NULL;
     7536    while (pLocalStorage)
     7537    {
     7538        PKWLOCALSTORAGE pNext = pLocalStorage->pNext;
     7539        KW_LOG(("Freeing leaked TlsAlloc index %#x\n", pLocalStorage->idx));
     7540        TlsFree(pLocalStorage->idx);
     7541        kHlpFree(pLocalStorage);
     7542        pLocalStorage = pNext;
     7543    }
     7544
     7545
     7546    /*
     7547     * Then free resources associated with the sandbox run.
     7548     */
    75167549
    75177550#ifdef WITH_TEMP_MEMORY_FILES
     
    75337566#endif
    75347567
     7568    /* Free left behind HeapCreate leaks. */
     7569    pHeap = g_Sandbox.pHeapHead;
     7570    g_Sandbox.pHeapHead = NULL;
     7571    while (pHeap != NULL)
     7572    {
     7573        PKWHEAP pNext = pHeap->pNext;
     7574        KW_LOG(("Freeing HeapCreate leak %p\n", pHeap->hHeap));
     7575        HeapDestroy(pHeap->hHeap);
     7576        pHeap = pNext;
     7577    }
     7578
    75357579    /* Free left behind VirtualAlloc leaks. */
    75367580    pTracker = g_Sandbox.pVirtualAllocHead;
     
    75447588        pTracker = pNext;
    75457589    }
    7546 
    7547     /* Free left behind HeapCreate leaks. */
    7548     pHeap = g_Sandbox.pHeapHead;
    7549     g_Sandbox.pHeapHead = NULL;
    7550     while (pHeap != NULL)
    7551     {
    7552         PKWHEAP pNext = pHeap->pNext;
    7553         KW_LOG(("Freeing HeapCreate leak %p\n", pHeap->hHeap));
    7554         HeapDestroy(pHeap->hHeap);
    7555         pHeap = pNext;
    7556     }
    7557 
    7558     /* Free left behind FlsAlloc leaks. */
    7559     pLocalStorage = g_Sandbox.pFlsAllocHead;
    7560     g_Sandbox.pFlsAllocHead = NULL;
    7561     while (pLocalStorage)
    7562     {
    7563         PKWLOCALSTORAGE pNext = pLocalStorage->pNext;
    7564         KW_LOG(("Freeing leaked FlsAlloc index %#x\n", pLocalStorage->idx));
    7565         FlsFree(pLocalStorage->idx);
    7566         kHlpFree(pLocalStorage);
    7567         pLocalStorage = pNext;
    7568     }
    7569 
    7570     /* Free left behind TlsAlloc leaks. */
    7571     pLocalStorage = g_Sandbox.pTlsAllocHead;
    7572     g_Sandbox.pTlsAllocHead = NULL;
    7573     while (pLocalStorage)
    7574     {
    7575         PKWLOCALSTORAGE pNext = pLocalStorage->pNext;
    7576         KW_LOG(("Freeing leaked TlsAlloc index %#x\n", pLocalStorage->idx));
    7577         TlsFree(pLocalStorage->idx);
    7578         kHlpFree(pLocalStorage);
    7579         pLocalStorage = pNext;
    7580     }
    7581 
    75827590
    75837591    /* Free the environment. */
     
    81848192        /* Optional directory change. */
    81858193        if (   i < argc
    8186             && strcmp(argv[i], "--chdir") == 0)
     8194            && (   strcmp(argv[i], "--chdir") == 0
     8195                || strcmp(argv[i], "-C")      == 0 ) )
    81878196        {
    81888197            i++;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette