Changeset 1862 in kBuild for trunk/src/kmk/incdep.c
- Timestamp:
- Oct 14, 2008 1:04:03 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kmk/incdep.c
r1854 r1862 150 150 const char *err_msg; 151 151 152 struct dep *dep_start; /* start of the current dep block. */ 153 struct dep *dep_end; /* end of the current dep block. */ 154 152 155 struct incdep_variable_in_set *recorded_variables_in_set_head; 153 156 struct incdep_variable_in_set *recorded_variables_in_set_tail; … … 233 236 For working around multithreaded performance problems found on Darwin, 234 237 Linux (glibc), and possibly other systems. */ 235 static void *incdep_xmalloc (struct incdep *cur, size_t size) 238 static void * 239 incdep_xmalloc (struct incdep *cur, size_t size) 236 240 { 237 241 void *ptr; … … 255 259 256 260 /* memset(malloc(sz),'\0',sz) wrapper. */ 257 static void *incdep_xcalloc (struct incdep *cur, size_t size) 261 static void * 262 incdep_xcalloc (struct incdep *cur, size_t size) 258 263 { 259 264 void *ptr; … … 275 280 276 281 /* free wrapper */ 277 static void incdep_xfree (struct incdep *cur, void *ptr) 282 static void 283 incdep_xfree (struct incdep *cur, void *ptr) 278 284 { 279 285 /* free() *must* work for the allocation hacks above because … … 283 289 } 284 290 291 /* alloc a dep structure. These are allocated in bunches to save time. */ 292 struct dep * 293 incdep_alloc_dep (struct incdep *cur) 294 { 295 if (cur->dep_start != cur->dep_end) 296 return cur->dep_start++; 297 298 cur->dep_start = (struct dep *)incdep_xcalloc (cur, sizeof(struct dep) * 256); 299 cur->dep_end = cur->dep_start + 256; 300 return cur->dep_start++; 301 } 285 302 286 303 … … 457 474 incdep_worker (void) 458 475 { 476 #ifdef PARSE_IN_WORKER 477 struct dep *dep_start = NULL; 478 struct dep *dep_end = NULL; 479 #endif 480 459 481 incdep_lock (); 460 482 … … 480 502 cur->is_worker = 1; 481 503 incdep_read_file (cur, NILF); 504 482 505 #ifdef PARSE_IN_WORKER 506 cur->dep_start = dep_start; 507 cur->dep_end = dep_end; 508 483 509 eval_include_dep_file (cur, NILF); 484 #endif 510 511 dep_start = cur->dep_start; 512 cur->dep_start = NULL; 513 dep_end = cur->dep_end; 514 cur->dep_end = NULL; 515 #endif 516 485 517 cur->is_worker = 0; 486 518 incdep_lock (); … … 1337 1369 1338 1370 /* add it to the list. */ 1339 *nextdep = dep = incdep_ xcalloc (curdep, sizeof (*dep));1371 *nextdep = dep = incdep_alloc_dep (curdep); 1340 1372 dep->name = incdep_record_strcache (curdep, cur, endp - cur); 1341 1373 dep->includedep = 1; … … 1441 1473 cur->err_line_no = 0; 1442 1474 cur->err_msg = NULL; 1475 cur->dep_start = NULL; 1476 cur->dep_end = NULL; 1443 1477 cur->recorded_variables_in_set_head = NULL; 1444 1478 cur->recorded_variables_in_set_tail = NULL;
Note:
See TracChangeset
for help on using the changeset viewer.