Changeset 1042


Ignore:
Timestamp:
Jun 8, 2007, 10:12:31 PM (18 years ago)
Author:
bird
Message:

bugfixing.

File:
1 edited

Legend:

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

    r1041 r1042  
    2929*   Header Files                                                               *
    3030*******************************************************************************/
     31#if 0
     32# define ELECTRIC_HEAP
     33# include "../kmk/electric.h"
     34#endif
    3135#include <string.h>
    3236#include <stdlib.h>
     
    191195}
    192196
    193 
     197#ifndef ELECTRIC_HEAP
    194198void *xmalloc(size_t cb)
    195199{
     
    201205
    202206
    203 void *xmallocz(size_t cb)
    204 {
    205     void *pv = xmalloc(cb);
    206     memset(pv, 0, cb);
    207     return pv;
    208 }
    209 
    210 
    211207void *xrealloc(void *pvOld, size_t cb)
    212208{
     
    225221    return psz;
    226222}
     223#endif
     224
     225
     226void *xmallocz(size_t cb)
     227{
     228    void *pv = xmalloc(cb);
     229    memset(pv, 0, cb);
     230    return pv;
     231}
     232
     233
    227234
    228235
     
    684691{
    685692    MD5Final(&pSum->md5[0], &pCtx->MD5Ctx);
     693    pSum->fUsed = 1;
    686694}
    687695
     
    9921000    if (!off)
    9931001        FatalDie("Failed to find abs path for '%s'!\n", pszFilename);
    994     pEntry->pszDir = xmalloc(off - 1);
    995     memcpy(pEntry->pszDir, pEntry->pszAbsPath, off);
     1002    pEntry->pszDir = xmalloc(off);
     1003    memcpy(pEntry->pszDir, pEntry->pszAbsPath, off - 1);
    9961004    pEntry->pszDir[off - 1] = '\0';
    9971005
     
    10671075            int fBad = 0;
    10681076            int fBadBeforeMissing = 1;
    1069             int fFirstSum = 1;
    10701077            while (fgets(g_szLine, sizeof(g_szLine), pFile))
    10711078            {
     
    11051112                        break;
    11061113                }
     1114                else if (!strcmp(g_szLine, "cpp-sum"))
     1115                {
     1116                    KOCSUM Sum;
     1117                    if ((fBad = kOCSumInitFromString(&Sum, pszVal)))
     1118                        break;
     1119                    kOCSumAdd(&pEntry->Old.SumHead, &Sum);
     1120                }
    11071121                else if (!strcmp(g_szLine, "cc-argc"))
    11081122                {
     
    11201134                    pEntry->Old.papszArgvCompile[i] = xstrdup(pszVal);
    11211135                }
    1122                 else if (!strcmp(g_szLine, "sum"))
     1136                else if (!strcmp(g_szLine, "cc-argv-sum"))
    11231137                {
    1124                     KOCSUM Sum;
    1125                     if ((fBad = kOCSumInitFromString(&Sum, pszVal)))
     1138                    if ((fBad = !kOCSumIsEmpty(&pEntry->Old.SumCompArgv)))
    11261139                        break;
    1127                     kOCSumAdd(&pEntry->Old.SumHead, &Sum);
     1140                    if ((fBad = kOCSumInitFromString(&pEntry->Old.SumCompArgv, pszVal)))
     1141                        break;
    11281142                }
    11291143                else if (!strcmp(g_szLine, "target"))
     
    11331147                    pEntry->Old.pszTarget = xstrdup(pszVal);
    11341148                }
     1149                else if (!strcmp(g_szLine, "key"))
     1150                {
     1151                    char *pszNext;
     1152                    if ((fBad = pEntry->uKey != 0))
     1153                        break;
     1154                    pEntry->uKey = strtoul(pszVal, &pszNext, 0);
     1155                    if ((fBad = pszNext && *pszNext))
     1156                        break;
     1157                }
    11351158                else if (!strcmp(g_szLine, "the-end"))
    11361159                {
    1137                     fBadBeforeMissing = fBad = !strcmp(pszVal, "fine");
     1160                    fBadBeforeMissing = fBad = strcmp(pszVal, "fine");
    11381161                    break;
    11391162                }
     
    11601183                         || !pEntry->Old.pszObjName
    11611184                         || !pEntry->Old.pszCppName
    1162                          || fFirstSum))
     1185                         || kOCSumIsEmpty(&pEntry->Old.SumHead)))
    11631186                    fBad = 1;
    11641187                if (!fBad)
     
    12271250    unsigned i;
    12281251
    1229     InfoMsg(1, "writing cache file...\n");
     1252    InfoMsg(1, "writing cache entry '%s'...\n", pEntry->pszName);
    12301253    pFile = FOpenFileInDir(pEntry->pszName, pEntry->pszDir, "wb");
    12311254    if (!pFile)
     
    12381261    fprintf(pFile, "magic=kObjCache-1\n");
    12391262    CHECK_LEN(fprintf(pFile, "target=%s\n", pEntry->New.pszTarget ? pEntry->New.pszTarget : pEntry->Old.pszTarget));
     1263    CHECK_LEN(fprintf(pFile, "key=%u\n", (unsigned long)pEntry->uKey));
    12401264    CHECK_LEN(fprintf(pFile, "obj=%s\n", pEntry->New.pszObjName ? pEntry->New.pszObjName : pEntry->Old.pszObjName));
    12411265    CHECK_LEN(fprintf(pFile, "cpp=%s\n", pEntry->New.pszCppName ? pEntry->New.pszCppName : pEntry->Old.pszCppName));
     
    12601284
    12611285
    1262     for (pSum = kOCSumIsEmpty(&pEntry->New.SumHead) ? &pEntry->New.SumHead : &pEntry->Old.SumHead;
     1286    for (pSum = !kOCSumIsEmpty(&pEntry->New.SumHead) ? &pEntry->New.SumHead : &pEntry->Old.SumHead;
    12631287         pSum;
    12641288         pSum = pSum->pNext)
    12651289    {
    1266         fprintf(pFile, "sum=");
     1290        fprintf(pFile, "cpp-sum=");
    12671291        kOCSumFPrintf(pSum, pFile);
    12681292    }
     
    12771301     * files the next time or upset make with new timestamps.
    12781302     */
     1303    errno = 0;
    12791304    if (    fflush(pFile) < 0
    12801305        ||  ferror(pFile))
     
    13221347     */
    13231348    pEntry->New.cArgvCompile = cArgvCompile;
    1324     pEntry->New.papszArgvCompile = xmalloc(cArgvCompile + 1);
     1349    pEntry->New.papszArgvCompile = xmalloc((cArgvCompile + 1) * sizeof(pEntry->New.papszArgvCompile[0]));
    13251350    kOCSumInitWithCtx(&pEntry->New.SumCompArgv, &Ctx);
    13261351    for (i = 0; i < cArgvCompile; i++)
    13271352    {
    13281353        pEntry->New.papszArgvCompile[i] = xstrdup(papszArgvCompile[i]);
    1329         kOCSumUpdate(&pEntry->New.SumCompArgv, &Ctx, papszArgvCompile[i], strlen(papszArgvCompile[i]));
     1354        kOCSumUpdate(&pEntry->New.SumCompArgv, &Ctx, papszArgvCompile[i], strlen(papszArgvCompile[i]) + 1);
    13301355    }
    13311356    kOCSumFinalize(&pEntry->New.SumCompArgv, &Ctx);
    13321357    pEntry->New.papszArgvCompile[i] = NULL; /* for exev/spawnv */
     1358    kOCSumInfo(&pEntry->New.SumCompArgv, 1, "comp-argv");
    13331359
    13341360    /*
     
    17751801    kOCSumUpdate(&pEntry->New.SumHead, &Ctx, pEntry->New.pszCppMapping, pEntry->New.cbCpp);
    17761802    kOCSumFinalize(&pEntry->New.SumHead, &Ctx);
    1777     kOCSumInfo(&pEntry->New.SumHead, 1, "");
     1803    kOCSumInfo(&pEntry->New.SumHead, 1, "cpp (file)");
    17781804}
    17791805
     
    18381864    pEntry->New.cbCpp = cbAlloc - cbLeft;
    18391865    kOCSumFinalize(&pEntry->New.SumHead, &Ctx);
     1866    kOCSumInfo(&pEntry->New.SumHead, 1, "cpp (pipe)");
    18401867}
    18411868
     
    19161943        long cbLeft;
    19171944        char *psz;
    1918         int fd = OpenFileInDir(pEntry->New.pszCppName, pEntry->pszDir, O_WRONLY | O_TRUNC | O_BINARY, 0666);
     1945        int fd = OpenFileInDir(pEntry->New.pszCppName, pEntry->pszDir,
     1946                               O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, 0666);
    19191947        if (fd == -1)
    19201948            FatalDie("Failed to create '%s' in '%s': %s\n",
     
    19351963                         pEntry->New.pszCppName, pEntry->pszDir, strerror(iErr));
    19361964            }
     1965
     1966            psz += cbWritten;
     1967            cbLeft -= cbWritten;
    19371968        }
    19381969        close(fd);
     
    20972128    pEntry->New.cbCpp = cbAlloc - cbLeft;
    20982129    kOCSumFinalize(&pEntry->New.SumHead, &Ctx);
     2130    kOCSumInfo(&pEntry->New.SumHead, 1, "cpp (tee)");
    20992131
    21002132    /*
     
    26682700
    26692701    pDigest->uKey = pEntry->uKey;
     2702    pDigest->pszTarget = xstrdup(pEntry->New.pszTarget ? pEntry->New.pszTarget : pEntry->Old.pszTarget);
    26702703
    26712704    kOCSumInit(&pDigest->SumCompArgv);
     
    27772810    /** The cache file descriptor. */
    27782811    int fd;
     2812    /** The stream associated with fd. */
     2813    FILE *pFile;
    27792814    /** Whether it's currently locked or not. */
    27802815    unsigned fLocked;
     
    28282863    if (!off)
    28292864        FatalDie("Failed to find abs path for '%s'!\n", pszCacheFile);
    2830     pCache->pszDir = xmalloc(off - 1);
    2831     memcpy(pCache->pszDir, pCache->pszAbsPath, off);
     2865    pCache->pszDir = xmalloc(off);
     2866    memcpy(pCache->pszDir, pCache->pszAbsPath, off - 1);
    28322867    pCache->pszDir[off - 1] = '\0';
    28332868
    28342869    return pCache;
     2870}
     2871
     2872
     2873/**
     2874 * Destroys the cache - closing any open files, freeing up heap memory and such.
     2875 *
     2876 * @param   pCache      The cache.
     2877 */
     2878static void kObjCacheDestroy(PKOBJCACHE pCache)
     2879{
     2880    if (pCache->pFile)
     2881    {
     2882        errno = 0;
     2883        if (fclose(pCache->pFile) != 0)
     2884            FatalMsg("fclose failed: %s\n", strerror(errno));
     2885        pCache->pFile = NULL;
     2886        pCache->fd = -1;
     2887    }
     2888    free(pCache->paDigests);
     2889    free(pCache->pszAbsPath);
     2890    free(pCache->pszDir);
     2891    free(pCache);
    28352892}
    28362893
     
    28592916static void kObjCacheRead(PKOBJCACHE pCache)
    28602917{
    2861     FILE *pFile;
    28622918    unsigned i;
     2919    char szBuf[8192];
    28632920    int fBad = 0;
    28642921
    28652922    /*
    2866      * Rewind the file and associate it with a buffered file stream.
     2923     * Rewind the file & stream, and associate a temporary buffer
     2924     * with the stream to speed up reading.
    28672925     */
    28682926    if (lseek(pCache->fd, 0, SEEK_SET) == -1)
    28692927        FatalDie("lseek(cache-fd) failed: %s\n", strerror(errno));
    2870     pFile = fdopen(pCache->fd, "rb");
    2871     if (!pFile)
     2928    rewind(pCache->pFile);
     2929    if (setvbuf(pCache->pFile, szBuf, _IOFBF, sizeof(szBuf)) != 0)
    28722930        FatalDie("fdopen(cache-fd,rb) failed: %s\n", strerror(errno));
    28732931
     
    28752933     * Read magic and generation.
    28762934     */
    2877     if (    !fgets(g_szLine, sizeof(g_szLine), pFile)
     2935    if (    !fgets(g_szLine, sizeof(g_szLine), pCache->pFile)
    28782936        ||  strcmp(g_szLine, "magic=kObjCache-v0.1.0\n"))
    28792937    {
     
    28812939        fBad = 1;
    28822940    }
    2883     else if (    !fgets(g_szLine, sizeof(g_szLine), pFile)
     2941    else if (    !fgets(g_szLine, sizeof(g_szLine), pCache->pFile)
    28842942             ||  strncmp(g_szLine, "generation=", sizeof("generation=") - 1))
    28852943    {
     
    28902948             && pCache->uGeneration == atol(&g_szLine[sizeof("generation=") - 1]))
    28912949    {
    2892         InfoMsg(1, "cache file unchanged\n");
     2950        InfoMsg(1, "drop re-read unmodified cache file\n");
    28932951        fBad = 0;
    28942952    }
     
    29222980            if (psz)
    29232981            {
    2924                 i = strtoul(psz, &psz, 0);
    2925                 if ((fBad = psz && *psz))
     2982                char *pszNext;
     2983                i = strtoul(++psz, &pszNext, 0);
     2984                if ((fBad = pszNext && *pszNext))
    29262985                    break;
    29272986                if ((fBad = i >= pCache->cDigests))
    29282987                    break;
    29292988                pDigest = &pCache->paDigests[i];
     2989                *psz = '\0';
    29302990            }
    29312991            else
     
    29342994
    29352995            /* string case on value name. */
    2936             if (!strncmp(g_szLine, "sum-#", sizeof("sum-sum-#") - 1))
     2996            if (!strcmp(g_szLine, "sum-#"))
    29372997            {
    29382998                KOCSUM Sum;
     
    29413001                kOCSumAdd(&pDigest->SumHead, &Sum);
    29423002            }
    2943             else if (!strncmp(g_szLine, "digest-abs-#", sizeof("digest-abs-#") - 1))
     3003            else if (!strcmp(g_szLine, "digest-abs-#"))
    29443004            {
    29453005                if ((fBad = pDigest->pszAbsPath != NULL))
     
    29473007                pDigest->pszAbsPath = xstrdup(pszVal);
    29483008            }
    2949             else if (!strncmp(g_szLine, "digest-rel-#", sizeof("digest-rel-#") - 1))
     3009            else if (!strcmp(g_szLine, "digest-rel-#"))
    29503010            {
    29513011                if ((fBad = pDigest->pszRelPath != NULL))
     
    29533013                pDigest->pszRelPath = xstrdup(pszVal);
    29543014            }
    2955             else if (!strncmp(g_szLine, "key-#", sizeof("key-#") - 1))
     3015            else if (!strcmp(g_szLine, "key-#"))
    29563016            {
    29573017                if ((fBad = pDigest->uKey != 0))
     
    29633023                    pCache->uNextKey = pDigest->uKey + 1;
    29643024            }
    2965             else if (!strncmp(g_szLine, "comp-argv-sum-#", sizeof("comp-argv-sum-#") - 1))
     3025            else if (!strcmp(g_szLine, "comp-argv-sum-#"))
    29663026            {
    29673027                if ((fBad = !kOCSumIsEmpty(&pDigest->SumCompArgv)))
     
    29703030                    break;
    29713031            }
    2972             else if (!strncmp(g_szLine, "target-#", sizeof("target-#") - 1))
     3032            else if (!strcmp(g_szLine, "target-#"))
    29733033            {
    29743034                if ((fBad = pDigest->pszTarget != NULL))
     
    30063066                break;
    30073067            }
    3008         } while (fgets(g_szLine, sizeof(g_szLine), pFile));
     3068        } while (fgets(g_szLine, sizeof(g_szLine), pCache->pFile));
    30093069
    30103070        /*
     
    30323092        if (fBad)
    30333093            InfoMsg(1, "bad cache file (%s)\n", fBadBeforeMissing ? g_szLine : "missing stuff");
    3034         else if (ferror(pFile))
     3094        else if (ferror(pCache->pFile))
    30353095        {
    30363096            InfoMsg(1, "cache file read error\n");
     
    30453105
    30463106    /*
    3047      * Close the stream.
    3048      */
    3049     fclose(pFile);
     3107     * Disassociate the buffer from the stream changing
     3108     * it to non-buffered mode.
     3109     */
     3110    if (setvbuf(pCache->pFile, NULL, _IONBF, 0) != 0)
     3111        FatalDie("setvbuf(,0,,0) failed: %s\n", strerror(errno));
    30503112}
    30513113
     
    30583120static void kObjCacheWrite(PKOBJCACHE pCache)
    30593121{
    3060     FILE *pFile;
    30613122    unsigned i;
    30623123    off_t cb;
     3124    char szBuf[8192];
    30633125    assert(pCache->fLocked);
    30643126    assert(pCache->fDirty);
    30653127
    30663128    /*
    3067      * Rewind the file and associate it with a buffered file stream.
     3129     * Rewind the file & stream, and associate a temporary buffer
     3130     * with the stream to speed up the writing.
    30683131     */
    30693132    if (lseek(pCache->fd, 0, SEEK_SET) == -1)
    30703133        FatalDie("lseek(cache-fd) failed: %s\n", strerror(errno));
    3071     pFile = fdopen(pCache->fd, "w+b");
    3072     if (!pFile)
    3073         FatalDie("fdopen(cache-fd,w+b) failed: %s\n", strerror(errno));
     3134    rewind(pCache->pFile);
     3135    if (setvbuf(pCache->pFile, szBuf, _IOFBF, sizeof(szBuf)) != 0)
     3136        FatalDie("setvbuf failed: %s\n", strerror(errno));
    30743137
    30753138    /*
     
    30773140     */
    30783141    pCache->uGeneration++;
    3079     fprintf(pFile,
     3142    fprintf(pCache->pFile,
    30803143            "magic=kObjCache-v0.1.0\n"
    30813144            "generation=%d\n"
     
    30873150     * Write the digests.
    30883151     */
    3089     for (i = 0; pCache->cDigests; i++)
     3152    for (i = 0; i < pCache->cDigests; i++)
    30903153    {
    30913154        PCKOCDIGEST pDigest = &pCache->paDigests[i];
     
    30933156
    30943157        if (pDigest->pszAbsPath)
    3095             fprintf(pFile, "digest-abs-#%u=%s\n", i, pDigest->pszAbsPath);
     3158            fprintf(pCache->pFile, "digest-abs-#%u=%s\n", i, pDigest->pszAbsPath);
    30963159        if (pDigest->pszRelPath)
    3097             fprintf(pFile, "digest-rel-#%u=%s\n", i, pDigest->pszRelPath);
    3098         fprintf(pFile, "key-#%u=%u\n", i, pDigest->uKey);
    3099         fprintf(pFile, "target-#%u=%s\n", i, pDigest->pszTarget);
    3100         fprintf(pFile, "comp-argv-sum-#%u=", i);
    3101         kOCSumFPrintf(&pDigest->SumCompArgv, pFile);
     3160            fprintf(pCache->pFile, "digest-rel-#%u=%s\n", i, pDigest->pszRelPath);
     3161        fprintf(pCache->pFile, "key-#%u=%u\n", i, pDigest->uKey);
     3162        fprintf(pCache->pFile, "target-#%u=%s\n", i, pDigest->pszTarget);
     3163        fprintf(pCache->pFile, "comp-argv-sum-#%u=", i);
     3164        kOCSumFPrintf(&pDigest->SumCompArgv, pCache->pFile);
    31023165        for (pSum = &pDigest->SumHead; pSum; pSum = pSum->pNext)
    31033166        {
    3104             fprintf(pFile, "sum-#%u=", i);
    3105             kOCSumFPrintf(pSum, pFile);
     3167            fprintf(pCache->pFile, "sum-#%u=", i);
     3168            kOCSumFPrintf(pSum, pCache->pFile);
    31063169        }
    31073170    }
     
    31113174     * (Closing the stream shouldn't close the file handle IIRC...)
    31123175     */
    3113     fprintf(pFile, "the-end=fine\n");
    3114     fflush(pFile);
    3115     if (    fflush(pFile) < 0
    3116         ||  ferror(pFile))
     3176    fprintf(pCache->pFile, "the-end=fine\n");
     3177    errno = 0;
     3178    if (    fflush(pCache->pFile) < 0
     3179        ||  ferror(pCache->pFile))
    31173180    {
    31183181        int iErr = errno;
    3119         fclose(pFile);
     3182        fclose(pCache->pFile);
    31203183        UnlinkFileInDir(pCache->pszName, pCache->pszDir);
    31213184        FatalDie("Stream error occured while writing '%s' in '%s': %s\n",
    31223185                 pCache->pszName, pCache->pszDir, strerror(iErr));
    31233186    }
    3124     fclose(pFile);
     3187    if (setvbuf(pCache->pFile, NULL, _IONBF, 0) != 0)
     3188        FatalDie("setvbuf(,0,,0) failed: %s\n", strerror(errno));
    31253189
    31263190    cb = lseek(pCache->fd, 0, SEEK_CUR);
     
    31333197#endif
    31343198        FatalDie("file truncation failed: %s\n", strerror(errno));
    3135     InfoMsg(1, "Wrote '%s' in '%s', %d bytes\n", pCache->pszName, pCache->pszDir, cb);
     3199    InfoMsg(1, "wrote '%s' in '%s', %d bytes\n", pCache->pszName, pCache->pszDir, cb);
    31363200}
    31373201
     
    31863250{
    31873251    struct stat st;
     3252#if defined(__WIN__)
     3253    OVERLAPPED OverLapped;
     3254#endif
     3255
    31883256    assert(!pCache->fLocked);
    31893257
     
    32013269                FatalDie("Failed to create '%s' in '%s': %s\n", pCache->pszName, pCache->pszDir, strerror(errno));
    32023270        }
     3271
     3272        pCache->pFile = fdopen(pCache->fd, "r+b");
     3273        if (!pCache->pFile)
     3274            FatalDie("fdopen failed: %s\n", strerror(errno));
     3275        if (setvbuf(pCache->pFile, NULL, _IONBF, 0) != 0)
     3276            FatalDie("setvbuf(,0,,0) failed: %s\n", strerror(errno));
    32033277    }
    32043278
     
    32073281     */
    32083282#if defined(__WIN__)
    3209     if (!LockFileEx((HANDLE)_get_osfhandle(pCache->fd), LOCKFILE_EXCLUSIVE_LOCK, 0, ~0, 0, NULL))
     3283    memset(&OverLapped, 0, sizeof(OverLapped));
     3284    if (!LockFileEx((HANDLE)_get_osfhandle(pCache->fd), LOCKFILE_EXCLUSIVE_LOCK, 0, ~0, 0, &OverLapped))
    32103285        FatalDie("Failed to lock the cache file: Windows Error %d\n", GetLastError());
    32113286#else
     
    32373312static void kObjCacheUnlock(PKOBJCACHE pCache)
    32383313{
     3314#if defined(__WIN__)
     3315    OVERLAPPED OverLapped;
     3316#endif
    32393317    assert(pCache->fLocked);
    32403318
     
    32553333     */
    32563334#if defined(__WIN__)
    3257     if (!UnlockFileEx((HANDLE)_get_osfhandle(pCache->fd), 0, ~0U, 0, NULL))
     3335    memset(&OverLapped, 0, sizeof(OverLapped));
     3336    if (!UnlockFileEx((HANDLE)_get_osfhandle(pCache->fd), 0, ~0U, 0, &OverLapped))
    32583337        FatalDie("Failed to unlock the cache file: Windows Error %d\n", GetLastError());
    32593338#else
     
    33133392     */
    33143393    pEntry->uKey = pCache->uNextKey++;
     3394    if (!pEntry->uKey)
     3395        pEntry->uKey = pCache->uNextKey++;
    33153396    i = pCache->cDigests;
    33163397    while (i-- > 0)
     
    33283409    if (    !(pCache->cDigests & 3)
    33293410        &&  (pCache->cDigests || !pCache->paDigests))
    3330         pCache->paDigests = xrealloc(pCache->paDigests, sizeof(pCache->paDigests[0]) * pCache->cDigests + 4);
     3411        pCache->paDigests = xrealloc(pCache->paDigests, sizeof(pCache->paDigests[0]) * (pCache->cDigests + 4));
    33313412
    33323413    /*
     
    36193700    pCache = kObjCacheCreate(pszCacheFile);
    36203701
    3621     pEntry = kOCEntryCreate(pszCacheFile);
     3702    pEntry = kOCEntryCreate(pszEntryFile);
    36223703    kOCEntryRead(pEntry);
    36233704    kOCEntrySetCompileArgv(pEntry, papszArgvCompile, cArgvCompile);
     
    36383719         * Optimize this path as it is frequently used when making a clean build.
    36393720         */
     3721        kObjCacheUnlock(pCache);
    36403722        kOCEntryPreCompileAndCompile(pEntry, papszArgvPreComp, cArgvPreComp);
     3723        kObjCacheLock(pCache);
    36413724    }
    36423725    else
     
    36703753            }
    36713754        }
     3755        else
     3756            kObjCacheLock(pCache);
    36723757    }
    36733758
     
    36783763    kOCEntryWrite(pEntry);
    36793764    kObjCacheUnlock(pCache);
     3765    kObjCacheDestroy(pCache);
    36803766    return 0;
    36813767}
Note: See TracChangeset for help on using the changeset viewer.