Ignore:
Timestamp:
Oct 17, 2008, 1:15:30 AM (17 years ago)
Author:
bird
Message:

kmk: replaced strcache with strcacahe2.

File:
1 edited

Legend:

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

    r1858 r1870  
    1616
    1717#include "make.h"
     18#ifndef CONFIG_WITH_STRCACHE2
    1819
    1920#include <assert.h>
    2021
    2122#include "hash.h"
     23
    2224
    2325/* The size (in bytes) of each cache buffer.
     
    381383/* Performs the prehashing for use with strcache_add_prehashed(). */
    382384void
    383 strcache_prehash_str (const char *str, unsigned long *hash1p,
     385strcache_prehash_str (const char *str, unsigned int len, unsigned long *hash1p,
    384386                      unsigned long *hash2p)
    385387{
     388  (void)len;
    386389  *hash1p = str_hash_1 (str);
    387390  *hash2p = str_hash_2 (str);
     
    460463  hash_print_stats (&strings, stdout);
    461464}
     465
     466#else /* CONFIG_WITH_STRCACHE2 */
     467
     468#include "strcache2.h"
     469
     470/* The file string cache. */
     471struct strcache2 file_strcache;
     472
     473void strcache_init (void)
     474{
     475  strcache2_init(&file_strcache,
     476                 "file",        /* name */
     477                 65536,         /* hash size */
     478                 0,             /* default segment size*/
     479#ifdef HAVE_CASE_INSENSITIVE_FS
     480                 1,             /* case insensitive */
     481#else
     482                 0,             /* case insensitive */
     483#endif
     484                 0);            /* thread safe */
     485}
     486
     487void
     488strcache_print_stats (const char *prefix)
     489{
     490  strcache2_print_stats (&file_strcache, prefix);
     491}
     492
     493
     494#endif /* CONFIG_WITH_STRCACHE2 */
Note: See TracChangeset for help on using the changeset viewer.