Changeset 1042
- Timestamp:
- Jun 8, 2007, 10:12:31 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kObjCache/kObjCache.c
r1041 r1042 29 29 * Header Files * 30 30 *******************************************************************************/ 31 #if 0 32 # define ELECTRIC_HEAP 33 # include "../kmk/electric.h" 34 #endif 31 35 #include <string.h> 32 36 #include <stdlib.h> … … 191 195 } 192 196 193 197 #ifndef ELECTRIC_HEAP 194 198 void *xmalloc(size_t cb) 195 199 { … … 201 205 202 206 203 void *xmallocz(size_t cb)204 {205 void *pv = xmalloc(cb);206 memset(pv, 0, cb);207 return pv;208 }209 210 211 207 void *xrealloc(void *pvOld, size_t cb) 212 208 { … … 225 221 return psz; 226 222 } 223 #endif 224 225 226 void *xmallocz(size_t cb) 227 { 228 void *pv = xmalloc(cb); 229 memset(pv, 0, cb); 230 return pv; 231 } 232 233 227 234 228 235 … … 684 691 { 685 692 MD5Final(&pSum->md5[0], &pCtx->MD5Ctx); 693 pSum->fUsed = 1; 686 694 } 687 695 … … 992 1000 if (!off) 993 1001 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); 996 1004 pEntry->pszDir[off - 1] = '\0'; 997 1005 … … 1067 1075 int fBad = 0; 1068 1076 int fBadBeforeMissing = 1; 1069 int fFirstSum = 1;1070 1077 while (fgets(g_szLine, sizeof(g_szLine), pFile)) 1071 1078 { … … 1105 1112 break; 1106 1113 } 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 } 1107 1121 else if (!strcmp(g_szLine, "cc-argc")) 1108 1122 { … … 1120 1134 pEntry->Old.papszArgvCompile[i] = xstrdup(pszVal); 1121 1135 } 1122 else if (!strcmp(g_szLine, " sum"))1136 else if (!strcmp(g_szLine, "cc-argv-sum")) 1123 1137 { 1124 KOCSUM Sum; 1125 if ((fBad = kOCSumInitFromString(&Sum, pszVal))) 1138 if ((fBad = !kOCSumIsEmpty(&pEntry->Old.SumCompArgv))) 1126 1139 break; 1127 kOCSumAdd(&pEntry->Old.SumHead, &Sum); 1140 if ((fBad = kOCSumInitFromString(&pEntry->Old.SumCompArgv, pszVal))) 1141 break; 1128 1142 } 1129 1143 else if (!strcmp(g_szLine, "target")) … … 1133 1147 pEntry->Old.pszTarget = xstrdup(pszVal); 1134 1148 } 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 } 1135 1158 else if (!strcmp(g_szLine, "the-end")) 1136 1159 { 1137 fBadBeforeMissing = fBad = !strcmp(pszVal, "fine");1160 fBadBeforeMissing = fBad = strcmp(pszVal, "fine"); 1138 1161 break; 1139 1162 } … … 1160 1183 || !pEntry->Old.pszObjName 1161 1184 || !pEntry->Old.pszCppName 1162 || fFirstSum))1185 || kOCSumIsEmpty(&pEntry->Old.SumHead))) 1163 1186 fBad = 1; 1164 1187 if (!fBad) … … 1227 1250 unsigned i; 1228 1251 1229 InfoMsg(1, "writing cache file...\n");1252 InfoMsg(1, "writing cache entry '%s'...\n", pEntry->pszName); 1230 1253 pFile = FOpenFileInDir(pEntry->pszName, pEntry->pszDir, "wb"); 1231 1254 if (!pFile) … … 1238 1261 fprintf(pFile, "magic=kObjCache-1\n"); 1239 1262 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)); 1240 1264 CHECK_LEN(fprintf(pFile, "obj=%s\n", pEntry->New.pszObjName ? pEntry->New.pszObjName : pEntry->Old.pszObjName)); 1241 1265 CHECK_LEN(fprintf(pFile, "cpp=%s\n", pEntry->New.pszCppName ? pEntry->New.pszCppName : pEntry->Old.pszCppName)); … … 1260 1284 1261 1285 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; 1263 1287 pSum; 1264 1288 pSum = pSum->pNext) 1265 1289 { 1266 fprintf(pFile, " sum=");1290 fprintf(pFile, "cpp-sum="); 1267 1291 kOCSumFPrintf(pSum, pFile); 1268 1292 } … … 1277 1301 * files the next time or upset make with new timestamps. 1278 1302 */ 1303 errno = 0; 1279 1304 if ( fflush(pFile) < 0 1280 1305 || ferror(pFile)) … … 1322 1347 */ 1323 1348 pEntry->New.cArgvCompile = cArgvCompile; 1324 pEntry->New.papszArgvCompile = xmalloc( cArgvCompile + 1);1349 pEntry->New.papszArgvCompile = xmalloc((cArgvCompile + 1) * sizeof(pEntry->New.papszArgvCompile[0])); 1325 1350 kOCSumInitWithCtx(&pEntry->New.SumCompArgv, &Ctx); 1326 1351 for (i = 0; i < cArgvCompile; i++) 1327 1352 { 1328 1353 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); 1330 1355 } 1331 1356 kOCSumFinalize(&pEntry->New.SumCompArgv, &Ctx); 1332 1357 pEntry->New.papszArgvCompile[i] = NULL; /* for exev/spawnv */ 1358 kOCSumInfo(&pEntry->New.SumCompArgv, 1, "comp-argv"); 1333 1359 1334 1360 /* … … 1775 1801 kOCSumUpdate(&pEntry->New.SumHead, &Ctx, pEntry->New.pszCppMapping, pEntry->New.cbCpp); 1776 1802 kOCSumFinalize(&pEntry->New.SumHead, &Ctx); 1777 kOCSumInfo(&pEntry->New.SumHead, 1, " ");1803 kOCSumInfo(&pEntry->New.SumHead, 1, "cpp (file)"); 1778 1804 } 1779 1805 … … 1838 1864 pEntry->New.cbCpp = cbAlloc - cbLeft; 1839 1865 kOCSumFinalize(&pEntry->New.SumHead, &Ctx); 1866 kOCSumInfo(&pEntry->New.SumHead, 1, "cpp (pipe)"); 1840 1867 } 1841 1868 … … 1916 1943 long cbLeft; 1917 1944 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); 1919 1947 if (fd == -1) 1920 1948 FatalDie("Failed to create '%s' in '%s': %s\n", … … 1935 1963 pEntry->New.pszCppName, pEntry->pszDir, strerror(iErr)); 1936 1964 } 1965 1966 psz += cbWritten; 1967 cbLeft -= cbWritten; 1937 1968 } 1938 1969 close(fd); … … 2097 2128 pEntry->New.cbCpp = cbAlloc - cbLeft; 2098 2129 kOCSumFinalize(&pEntry->New.SumHead, &Ctx); 2130 kOCSumInfo(&pEntry->New.SumHead, 1, "cpp (tee)"); 2099 2131 2100 2132 /* … … 2668 2700 2669 2701 pDigest->uKey = pEntry->uKey; 2702 pDigest->pszTarget = xstrdup(pEntry->New.pszTarget ? pEntry->New.pszTarget : pEntry->Old.pszTarget); 2670 2703 2671 2704 kOCSumInit(&pDigest->SumCompArgv); … … 2777 2810 /** The cache file descriptor. */ 2778 2811 int fd; 2812 /** The stream associated with fd. */ 2813 FILE *pFile; 2779 2814 /** Whether it's currently locked or not. */ 2780 2815 unsigned fLocked; … … 2828 2863 if (!off) 2829 2864 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); 2832 2867 pCache->pszDir[off - 1] = '\0'; 2833 2868 2834 2869 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 */ 2878 static 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); 2835 2892 } 2836 2893 … … 2859 2916 static void kObjCacheRead(PKOBJCACHE pCache) 2860 2917 { 2861 FILE *pFile;2862 2918 unsigned i; 2919 char szBuf[8192]; 2863 2920 int fBad = 0; 2864 2921 2865 2922 /* 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. 2867 2925 */ 2868 2926 if (lseek(pCache->fd, 0, SEEK_SET) == -1) 2869 2927 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) 2872 2930 FatalDie("fdopen(cache-fd,rb) failed: %s\n", strerror(errno)); 2873 2931 … … 2875 2933 * Read magic and generation. 2876 2934 */ 2877 if ( !fgets(g_szLine, sizeof(g_szLine), p File)2935 if ( !fgets(g_szLine, sizeof(g_szLine), pCache->pFile) 2878 2936 || strcmp(g_szLine, "magic=kObjCache-v0.1.0\n")) 2879 2937 { … … 2881 2939 fBad = 1; 2882 2940 } 2883 else if ( !fgets(g_szLine, sizeof(g_szLine), p File)2941 else if ( !fgets(g_szLine, sizeof(g_szLine), pCache->pFile) 2884 2942 || strncmp(g_szLine, "generation=", sizeof("generation=") - 1)) 2885 2943 { … … 2890 2948 && pCache->uGeneration == atol(&g_szLine[sizeof("generation=") - 1])) 2891 2949 { 2892 InfoMsg(1, " cache file unchanged\n");2950 InfoMsg(1, "drop re-read unmodified cache file\n"); 2893 2951 fBad = 0; 2894 2952 } … … 2922 2980 if (psz) 2923 2981 { 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)) 2926 2985 break; 2927 2986 if ((fBad = i >= pCache->cDigests)) 2928 2987 break; 2929 2988 pDigest = &pCache->paDigests[i]; 2989 *psz = '\0'; 2930 2990 } 2931 2991 else … … 2934 2994 2935 2995 /* string case on value name. */ 2936 if (!str ncmp(g_szLine, "sum-#", sizeof("sum-sum-#") - 1))2996 if (!strcmp(g_szLine, "sum-#")) 2937 2997 { 2938 2998 KOCSUM Sum; … … 2941 3001 kOCSumAdd(&pDigest->SumHead, &Sum); 2942 3002 } 2943 else if (!str ncmp(g_szLine, "digest-abs-#", sizeof("digest-abs-#") - 1))3003 else if (!strcmp(g_szLine, "digest-abs-#")) 2944 3004 { 2945 3005 if ((fBad = pDigest->pszAbsPath != NULL)) … … 2947 3007 pDigest->pszAbsPath = xstrdup(pszVal); 2948 3008 } 2949 else if (!str ncmp(g_szLine, "digest-rel-#", sizeof("digest-rel-#") - 1))3009 else if (!strcmp(g_szLine, "digest-rel-#")) 2950 3010 { 2951 3011 if ((fBad = pDigest->pszRelPath != NULL)) … … 2953 3013 pDigest->pszRelPath = xstrdup(pszVal); 2954 3014 } 2955 else if (!str ncmp(g_szLine, "key-#", sizeof("key-#") - 1))3015 else if (!strcmp(g_szLine, "key-#")) 2956 3016 { 2957 3017 if ((fBad = pDigest->uKey != 0)) … … 2963 3023 pCache->uNextKey = pDigest->uKey + 1; 2964 3024 } 2965 else if (!str ncmp(g_szLine, "comp-argv-sum-#", sizeof("comp-argv-sum-#") - 1))3025 else if (!strcmp(g_szLine, "comp-argv-sum-#")) 2966 3026 { 2967 3027 if ((fBad = !kOCSumIsEmpty(&pDigest->SumCompArgv))) … … 2970 3030 break; 2971 3031 } 2972 else if (!str ncmp(g_szLine, "target-#", sizeof("target-#") - 1))3032 else if (!strcmp(g_szLine, "target-#")) 2973 3033 { 2974 3034 if ((fBad = pDigest->pszTarget != NULL)) … … 3006 3066 break; 3007 3067 } 3008 } while (fgets(g_szLine, sizeof(g_szLine), p File));3068 } while (fgets(g_szLine, sizeof(g_szLine), pCache->pFile)); 3009 3069 3010 3070 /* … … 3032 3092 if (fBad) 3033 3093 InfoMsg(1, "bad cache file (%s)\n", fBadBeforeMissing ? g_szLine : "missing stuff"); 3034 else if (ferror(p File))3094 else if (ferror(pCache->pFile)) 3035 3095 { 3036 3096 InfoMsg(1, "cache file read error\n"); … … 3045 3105 3046 3106 /* 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)); 3050 3112 } 3051 3113 … … 3058 3120 static void kObjCacheWrite(PKOBJCACHE pCache) 3059 3121 { 3060 FILE *pFile;3061 3122 unsigned i; 3062 3123 off_t cb; 3124 char szBuf[8192]; 3063 3125 assert(pCache->fLocked); 3064 3126 assert(pCache->fDirty); 3065 3127 3066 3128 /* 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. 3068 3131 */ 3069 3132 if (lseek(pCache->fd, 0, SEEK_SET) == -1) 3070 3133 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)); 3074 3137 3075 3138 /* … … 3077 3140 */ 3078 3141 pCache->uGeneration++; 3079 fprintf(p File,3142 fprintf(pCache->pFile, 3080 3143 "magic=kObjCache-v0.1.0\n" 3081 3144 "generation=%d\n" … … 3087 3150 * Write the digests. 3088 3151 */ 3089 for (i = 0; pCache->cDigests; i++)3152 for (i = 0; i < pCache->cDigests; i++) 3090 3153 { 3091 3154 PCKOCDIGEST pDigest = &pCache->paDigests[i]; … … 3093 3156 3094 3157 if (pDigest->pszAbsPath) 3095 fprintf(p File, "digest-abs-#%u=%s\n", i, pDigest->pszAbsPath);3158 fprintf(pCache->pFile, "digest-abs-#%u=%s\n", i, pDigest->pszAbsPath); 3096 3159 if (pDigest->pszRelPath) 3097 fprintf(p File, "digest-rel-#%u=%s\n", i, pDigest->pszRelPath);3098 fprintf(p File, "key-#%u=%u\n", i, pDigest->uKey);3099 fprintf(p File, "target-#%u=%s\n", i, pDigest->pszTarget);3100 fprintf(p File, "comp-argv-sum-#%u=", i);3101 kOCSumFPrintf(&pDigest->SumCompArgv, p File);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); 3102 3165 for (pSum = &pDigest->SumHead; pSum; pSum = pSum->pNext) 3103 3166 { 3104 fprintf(p File, "sum-#%u=", i);3105 kOCSumFPrintf(pSum, p File);3167 fprintf(pCache->pFile, "sum-#%u=", i); 3168 kOCSumFPrintf(pSum, pCache->pFile); 3106 3169 } 3107 3170 } … … 3111 3174 * (Closing the stream shouldn't close the file handle IIRC...) 3112 3175 */ 3113 fprintf(p File, "the-end=fine\n");3114 fflush(pFile);3115 if ( fflush(p File) < 03116 || ferror(p File))3176 fprintf(pCache->pFile, "the-end=fine\n"); 3177 errno = 0; 3178 if ( fflush(pCache->pFile) < 0 3179 || ferror(pCache->pFile)) 3117 3180 { 3118 3181 int iErr = errno; 3119 fclose(p File);3182 fclose(pCache->pFile); 3120 3183 UnlinkFileInDir(pCache->pszName, pCache->pszDir); 3121 3184 FatalDie("Stream error occured while writing '%s' in '%s': %s\n", 3122 3185 pCache->pszName, pCache->pszDir, strerror(iErr)); 3123 3186 } 3124 fclose(pFile); 3187 if (setvbuf(pCache->pFile, NULL, _IONBF, 0) != 0) 3188 FatalDie("setvbuf(,0,,0) failed: %s\n", strerror(errno)); 3125 3189 3126 3190 cb = lseek(pCache->fd, 0, SEEK_CUR); … … 3133 3197 #endif 3134 3198 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); 3136 3200 } 3137 3201 … … 3186 3250 { 3187 3251 struct stat st; 3252 #if defined(__WIN__) 3253 OVERLAPPED OverLapped; 3254 #endif 3255 3188 3256 assert(!pCache->fLocked); 3189 3257 … … 3201 3269 FatalDie("Failed to create '%s' in '%s': %s\n", pCache->pszName, pCache->pszDir, strerror(errno)); 3202 3270 } 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)); 3203 3277 } 3204 3278 … … 3207 3281 */ 3208 3282 #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)) 3210 3285 FatalDie("Failed to lock the cache file: Windows Error %d\n", GetLastError()); 3211 3286 #else … … 3237 3312 static void kObjCacheUnlock(PKOBJCACHE pCache) 3238 3313 { 3314 #if defined(__WIN__) 3315 OVERLAPPED OverLapped; 3316 #endif 3239 3317 assert(pCache->fLocked); 3240 3318 … … 3255 3333 */ 3256 3334 #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)) 3258 3337 FatalDie("Failed to unlock the cache file: Windows Error %d\n", GetLastError()); 3259 3338 #else … … 3313 3392 */ 3314 3393 pEntry->uKey = pCache->uNextKey++; 3394 if (!pEntry->uKey) 3395 pEntry->uKey = pCache->uNextKey++; 3315 3396 i = pCache->cDigests; 3316 3397 while (i-- > 0) … … 3328 3409 if ( !(pCache->cDigests & 3) 3329 3410 && (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)); 3331 3412 3332 3413 /* … … 3619 3700 pCache = kObjCacheCreate(pszCacheFile); 3620 3701 3621 pEntry = kOCEntryCreate(psz CacheFile);3702 pEntry = kOCEntryCreate(pszEntryFile); 3622 3703 kOCEntryRead(pEntry); 3623 3704 kOCEntrySetCompileArgv(pEntry, papszArgvCompile, cArgvCompile); … … 3638 3719 * Optimize this path as it is frequently used when making a clean build. 3639 3720 */ 3721 kObjCacheUnlock(pCache); 3640 3722 kOCEntryPreCompileAndCompile(pEntry, papszArgvPreComp, cArgvPreComp); 3723 kObjCacheLock(pCache); 3641 3724 } 3642 3725 else … … 3670 3753 } 3671 3754 } 3755 else 3756 kObjCacheLock(pCache); 3672 3757 } 3673 3758 … … 3678 3763 kOCEntryWrite(pEntry); 3679 3764 kObjCacheUnlock(pCache); 3765 kObjCacheDestroy(pCache); 3680 3766 return 0; 3681 3767 }
Note:
See TracChangeset
for help on using the changeset viewer.