MCPcopy Create free account
hub / github.com/boostorg/build / hcache

Function hcache

v2/engine/hcache.c:429–517  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

427
428
429LIST * hcache( TARGET * t, int rec, regexp * re[], LIST * hdrscan )
430{
431 HCACHEDATA * c;
432
433 ++queries;
434
435 if ( ( c = (HCACHEDATA *)hash_find( hcachehash, t->boundname ) ) )
436 {
437 if ( !timestamp_cmp( &c->time, &t->time ) )
438 {
439 LIST * const l1 = hdrscan;
440 LIST * const l2 = c->hdrscan;
441 LISTITER iter1 = list_begin( l1 );
442 LISTITER const end1 = list_end( l1 );
443 LISTITER iter2 = list_begin( l2 );
444 LISTITER const end2 = list_end( l2 );
445 while ( iter1 != end1 && iter2 != end2 )
446 {
447 if ( !object_equal( list_item( iter1 ), list_item( iter2 ) ) )
448 iter1 = end1;
449 else
450 {
451 iter1 = list_next( iter1 );
452 iter2 = list_next( iter2 );
453 }
454 }
455 if ( iter1 != end1 || iter2 != end2 )
456 {
457 if ( DEBUG_HEADER )
458 {
459 printf( "HDRSCAN out of date in cache for %s\n",
460 object_str( t->boundname ) );
461 printf(" real : ");
462 list_print( hdrscan );
463 printf( "\n cached: " );
464 list_print( c->hdrscan );
465 printf( "\n" );
466 }
467
468 list_free( c->includes );
469 list_free( c->hdrscan );
470 c->includes = L0;
471 c->hdrscan = L0;
472 }
473 else
474 {
475 if ( DEBUG_HEADER )
476 printf( "using header cache for %s\n", object_str(
477 t->boundname ) );
478 c->age = 0;
479 ++hits;
480 return list_copy( c->includes );
481 }
482 }
483 else
484 {
485 if ( DEBUG_HEADER )
486 printf ("header cache out of date for %s\n", object_str(

Callers 1

headersFunction · 0.85

Calls 13

hash_findFunction · 0.85
timestamp_cmpFunction · 0.85
list_beginFunction · 0.85
list_endFunction · 0.85
object_equalFunction · 0.85
object_strFunction · 0.85
list_printFunction · 0.85
list_freeFunction · 0.85
list_copyFunction · 0.85
hash_insertFunction · 0.85
object_copyFunction · 0.85
headers1Function · 0.85

Tested by

no test coverage detected