Changeset 1933 for trunk


Ignore:
Timestamp:
Oct 24, 2008, 10:40:32 PM (17 years ago)
Author:
bird
Message:

kmk: moved suffixes_strcached to strcache.c and global scope.

Location:
trunk/src/kmk
Files:
4 edited

Legend:

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

    r1932 r1933  
    8585      const char *name;
    8686      unsigned int len;
    87 #ifdef CONFIG_WITH_STRCACHE2
    88       static const char *suffixes_strcache = 0; /* XXX: make this global */
    89 
    90       if (!suffixes_strcache)
    91         suffixes_strcache = strcache_add_len (".SUFFIXES", sizeof (".SUFFIXES") - 1);
    92 #endif /* CONFIG_WITH_STRCACHE2 */
    9387
    9488#ifndef NO_ARCHIVES
     
    114108          unsigned int slen = strlen (dep_name (d));
    115109#else
    116       for (d = enter_file (suffixes_strcache)->deps; d ; d = d->next)
     110      for (d = enter_file (suffixes_strcached)->deps; d ; d = d->next)
    117111        {
    118112          unsigned int slen = strcache2_get_len (&file_strcache, dep_name (d));
  • trunk/src/kmk/file.c

    r1918 r1933  
    863863  for (file_slot = file_slot_0; file_slot < file_end; file_slot++)
    864864    for (f = *file_slot; f != 0; f = f->prev)
     865#ifndef CONFIG_WITH_STRCACHE2
    865866      if (strcmp (f->name, ".SUFFIXES") != 0)
     867#else
     868      if (f->name != suffixes_strcached)
     869#endif
    866870        expand_deps (f);
    867871  free (file_slot_0);
  • trunk/src/kmk/make.h

    r1925 r1933  
    639639# include "strcache2.h"
    640640extern struct strcache2 file_strcache;
     641extern const char *suffixes_strcached;
    641642
    642643# define strcache_iscached(str)     strcache2_is_cached(&file_strcache, str)
  • trunk/src/kmk/strcache.c

    r1895 r1933  
    250250
    251251#include "strcache2.h"
     252
     253const char *suffixes_strcached;
    252254
    253255/* The file string cache. */
     
    266268#endif
    267269                 0);            /* thread safe */
     270
     271  /* .SUFFIXES is referenced in several loops, keep the added pointer in a
     272     global var so these can be optimized. */
     273
     274  suffixes_strcached = strcache_add_len (".SUFFIXES", sizeof (".SUFFIXES")-1);
    268275}
    269276
Note: See TracChangeset for help on using the changeset viewer.