Changeset 1843 for trunk/src/kmk/make.h


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

kmk/strcache: align the strings on a (somewhat) natural boundrary and offer a service for retrieving their length (which we also store now).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kmk/make.h

    r1842 r1843  
    504504const char *strcache_add_len (const char *str, int len);
    505505int strcache_setbufsize (int size);
     506#ifdef CONFIG_WITH_VALUE_LENGTH
     507MY_INLINE unsigned int strcache_get_len (const char *str)
     508{
     509  unsigned int len = ((unsigned int *)str)[-1];
     510  MY_ASSERT_MSG (strcache_iscached (str), ("\n"));
     511  MY_ASSERT_MSG (strlen (str) == len, ("\n"));
     512  return len;
     513}
     514#endif
    506515
    507516#ifdef  HAVE_VFORK_H
Note: See TracChangeset for help on using the changeset viewer.