From 9fae7b6d3fca02b4661aaa7c16e9fbeec8964b9b Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Tue, 22 Sep 2015 11:18:24 -0300 Subject: code for string cache generalized for "associative sets" (compiler will optimize away or inline the extra loops) --- llimits.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'llimits.h') diff --git a/llimits.h b/llimits.h index 29872ca3..d1dff19f 100644 --- a/llimits.h +++ b/llimits.h @@ -1,5 +1,5 @@ /* -** $Id: llimits.h,v 1.136 2015/07/15 15:57:13 roberto Exp roberto $ +** $Id: llimits.h,v 1.137 2015/09/08 16:53:56 roberto Exp roberto $ ** Limits, basic types, and some other 'installation-dependent' definitions ** See Copyright Notice in lua.h */ @@ -190,10 +190,13 @@ typedef unsigned long Instruction; /* -** Size of cache for strings in the API (better be a prime) +** Size of cache for strings in the API. 'N' is the number of +** sets (better be a prime) and "M" is the size of each set (M == 1 +** makes a direct cache.) */ -#if !defined(STRCACHE_SIZE) -#define STRCACHE_SIZE 127 +#if !defined(STRCACHE_N) +#define STRCACHE_N 63 +#define STRCACHE_M 2 #endif -- cgit v1.2.3-55-g6feb