Changeset 1857 for trunk/src/kmk/read.c


Ignore:
Timestamp:
Oct 13, 2008, 5:58:07 AM (17 years ago)
Author:
bird
Message:

kmk: improved the hashing of file table entries by making the strcache cache their hash values along with the string length.

File:
1 edited

Legend:

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

    r1853 r1857  
    418418  deps->next = read_makefiles;
    419419  read_makefiles = deps;
     420#ifndef KMK
    420421  deps->file = lookup_file (filename);
     422#else
     423  deps->file = lookup_file_cached (filename);
     424#endif
    421425  if (deps->file == 0)
    422426    deps->file = enter_file (filename);
     
    23022306             new entry if the file is a double-colon, which we don't want in
    23032307             this situation.  */
     2308#ifndef KMK
    23042309          f = lookup_file (name);
    23052310          if (!f)
    23062311            f = enter_file (strcache_add (name));
     2312#else  /* KMK */
     2313           /* XXX: this is probably already a cached string. */
     2314          fname = strcache_add (name);
     2315          f = lookup_file_cached (fname);
     2316          if (!f)
     2317            f = enter_file (fname);
     2318#endif
    23072319          else if (f->double_colon)
    23082320            f = f->double_colon;
     
    26452657        {
    26462658          /* Double-colon.  Make a new record even if there already is one.  */
     2659#ifndef KMK
    26472660          f = lookup_file (name);
     2661#else  /* KMK - the name is already in the cache, don't waste time.  */
     2662          f = lookup_file_cached (name);
     2663#endif
    26482664
    26492665          /* Check for both : and :: rules.  Check is_target so
     
    26522668            fatal (flocp,
    26532669                   _("target file `%s' has both : and :: entries"), f->name);
     2670#ifndef KMK
    26542671          f = enter_file (strcache_add (name));
     2672#else  /* KMK - the name is already in the cache, don't waste time.  */
     2673          f = enter_file (name);
     2674#endif
    26552675          /* If there was an existing entry and it was a double-colon entry,
    26562676             enter_file will have returned a new one, making it the prev
Note: See TracChangeset for help on using the changeset viewer.