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

Function hcache

src/engine/hcache.cpp:444–532  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

442
443
444LIST * hcache( TARGET * t, int rec, regexp * re[], LIST * hdrscan )
445{
446 HCACHEDATA * c;
447
448 ++queries;
449
450 if ( ( c = (HCACHEDATA *)hash_find( hcachehash, t->boundname ) ) )
451 {
452 if ( !timestamp_cmp( &c->time, &t->time ) )
453 {
454 LIST * const l1 = hdrscan;
455 LIST * const l2 = c->hdrscan;
456 LISTITER iter1 = list_begin( l1 );
457 LISTITER const end1 = list_end( l1 );
458 LISTITER iter2 = list_begin( l2 );
459 LISTITER const end2 = list_end( l2 );
460 while ( iter1 != end1 && iter2 != end2 )
461 {
462 if ( !object_equal( list_item( iter1 ), list_item( iter2 ) ) )
463 iter1 = end1;
464 else
465 {
466 iter1 = list_next( iter1 );
467 iter2 = list_next( iter2 );
468 }
469 }
470 if ( iter1 != end1 || iter2 != end2 )
471 {
472 if ( DEBUG_HEADER )
473 {
474 out_printf( "HDRSCAN out of date in cache for %s\n",
475 object_str( t->boundname ) );
476 out_printf(" real : ");
477 list_print( hdrscan );
478 out_printf( "\n cached: " );
479 list_print( c->hdrscan );
480 out_printf( "\n" );
481 }
482
483 list_free( c->includes );
484 list_free( c->hdrscan );
485 c->includes = L0;
486 c->hdrscan = L0;
487 }
488 else
489 {
490 if ( DEBUG_HEADER )
491 out_printf( "using header cache for %s\n", object_str(
492 t->boundname ) );
493 c->age = 0;
494 ++hits;
495 return list_copy( c->includes );
496 }
497 }
498 else
499 {
500 if ( DEBUG_HEADER )
501 out_printf ("header cache out of date for %s\n", object_str(

Callers 1

headersFunction · 0.85

Calls 14

hash_findFunction · 0.85
timestamp_cmpFunction · 0.85
list_beginFunction · 0.85
list_endFunction · 0.85
object_equalFunction · 0.85
out_printfFunction · 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

Tested by

no test coverage detected