Changeset 1863 for trunk/src/kmk/main.c


Ignore:
Timestamp:
Oct 14, 2008, 11:46:23 AM (17 years ago)
Author:
bird
Message:

kmk: Allocation caches for nameseq, dep and idep. next: variable.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kmk/main.c

    r1856 r1863  
    644644#endif
    645645
     646#ifdef CONFIG_WITH_ALLOC_CACHES
     647struct alloccache dep_cache;
     648struct alloccache nameseq_cache;
     649struct alloccache variable_cache;
     650
     651static void
     652initialize_global_alloc_caches (void)
     653{
     654  alloccache_init (&dep_cache,      sizeof (struct dep),      "dep",      NULL, NULL);
     655  alloccache_init (&nameseq_cache,  sizeof (struct nameseq),  "nameseq",  NULL, NULL);
     656  alloccache_init (&variable_cache, sizeof (struct variable), "variable", NULL, NULL);
     657}
     658#endif
     659
    646660static void
    647661initialize_global_hash_tables (void)
     
    12711285#ifndef ELECTRIC_HEAP /* Drop this because it prevent JIT debugging. */
    12721286  SetUnhandledExceptionFilter(handle_runtime_exceptions);
    1273 #endif /* !ELECTRICT_HEAP */
     1287#endif /* !ELECTRIC_HEAP */
    12741288
    12751289  /* start off assuming we have no shell */
     
    14681482  user_access ();
    14691483
     1484#ifdef CONFIG_WITH_ALLOC_CACHES
     1485  initialize_global_alloc_caches ();
     1486#endif
    14701487  initialize_global_hash_tables ();
    14711488
     
    26742691                    char *p = *default_goal_name;
    26752692
     2693#ifndef CONFIG_WITH_ALLOC_CACHES
    26762694                    ns = multi_glob (
    26772695                      parse_file_seq (&p, '\0', sizeof (struct nameseq), 1),
    26782696                      sizeof (struct nameseq));
     2697#else
     2698                    ns = multi_glob (
     2699                      parse_file_seq (&p, '\0', &nameseq_cache, 1),
     2700                      &nameseq_cache);
     2701#endif
    26792702
    26802703                    /* .DEFAULT_GOAL should contain one target. */
     
    36043627  print_vpath_data_base ();
    36053628  strcache_print_stats ("#");
     3629#ifdef CONFIG_WITH_ALLOC_CACHES
     3630  alloccache_print_all ();
     3631#endif
    36063632
    36073633  when = time ((time_t *) 0);
Note: See TracChangeset for help on using the changeset viewer.