Atrinik Server 2.5
Data Structures | Defines | Typedefs
include/shstr.h File Reference

Go to the source code of this file.

Data Structures

struct  _shared_string

Defines

#define TABLESIZE   8266
#define MAXSTRING   20
#define REFCOUNT_TYPE   long
#define offsetof(type, member)   (int)&(((type *)0)->member)
#define SS(x)   ((shared_string *) ((x) - offsetof(shared_string, string)))
#define SS_DUMP_TABLE   1
#define SS_DUMP_TOTALS   2
#define GATHER(n)
#define TOPBIT   ((unsigned REFCOUNT_TYPE) 1 << (sizeof(REFCOUNT_TYPE) * CHAR_BIT - 1))
#define PADDING   ((2 * sizeof(long) - sizeof(REFCOUNT_TYPE)) % sizeof(long)) + 1

Typedefs

typedef struct _shared_string shared_string

Detailed Description

Shared-strings defines.

Definition in file shstr.h.


Define Documentation

#define MAXSTRING   20

This specifies how many characters the hashing routine should look at. You may actually save CPU by increasing this number if the typical string is large.

Definition at line 49 of file shstr.h.

#define REFCOUNT_TYPE   long

In the unlikely occurrence that 16383 references to a string are too few, you can modify the below type to something bigger. (The top bit of "refcount" is used to signify that "u.array" points at the array entry.)

Definition at line 57 of file shstr.h.

#define SS (   x)    ((shared_string *) ((x) - offsetof(shared_string, string)))

SS(string) will return the address of the shared_string struct which contains "string".

Definition at line 68 of file shstr.h.

#define TABLESIZE   8266

The size of the shared strings hashtable.

Definition at line 35 of file shstr.h.


Typedef Documentation

typedef struct _shared_string shared_string

One actual shared string.