Back to index

glibc  2.9
Classes | Defines | Functions | Variables
3level.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  TABLE

Defines

#define CONCAT(a, b)   CONCAT1(a,b)
#define CONCAT1(a, b)   a##b
#define EMPTY   ((uint32_t) ~0)

Functions

static void CONCAT (TABLE, _init)(struct TABLE *t)
static ELEMENT __attribute ((always_inline)) CONCAT(TABLE
static ELEMENT _get (struct TABLE *t, uint32_t wc)
static void CONCAT (TABLE, _add)(struct TABLE *t

Variables

static void uint32_t wc

Class Documentation

struct TABLE

Definition at line 44 of file 3level.h.

Class Members
uint32_t * level1
size_t level1_alloc
size_t level1_size
uint32_t * level2
size_t level2_alloc
size_t level2_size
ELEMENT * level3
size_t level3_alloc
size_t level3_size
unsigned int p
unsigned int q
char * result
size_t result_size

Define Documentation

#define CONCAT (   a,
  b 
)    CONCAT1(a,b)

Definition at line 41 of file 3level.h.

#define CONCAT1 (   a,
  b 
)    a##b

Definition at line 42 of file 3level.h.

#define EMPTY   ((uint32_t) ~0)

Definition at line 78 of file 3level.h.


Function Documentation

static ELEMENT __attribute ( (always_inline)  ) [inline, static]
static ELEMENT _get ( struct TABLE t,
uint32_t  wc 
)

Definition at line 83 of file 3level.h.

{
  uint32_t index1 = wc >> (t->q + t->p);
  if (index1 < t->level1_size)
    {
      uint32_t lookup1 = t->level1[index1];
      if (lookup1 != EMPTY)
       {
         uint32_t index2 = ((wc >> t->p) & ((1 << t->q) - 1))
                         + (lookup1 << t->q);
         uint32_t lookup2 = t->level2[index2];
         if (lookup2 != EMPTY)
           {
             uint32_t index3 = (wc & ((1 << t->p) - 1))
                            + (lookup2 << t->p);
             ELEMENT lookup3 = t->level3[index3];

             return lookup3;
           }
       }
    }
  return DEFAULT;
}
static void CONCAT ( TABLE  ,
_init   
) [inline, static]

Definition at line 66 of file 3level.h.

{
  t->level1 = NULL;
  t->level1_alloc = t->level1_size = 0;
  t->level2 = NULL;
  t->level2_alloc = t->level2_size = 0;
  t->level3 = NULL;
  t->level3_alloc = t->level3_size = 0;
}
static void CONCAT ( TABLE  ,
_add   
) [static]

Variable Documentation

void uint32_t wc

Definition at line 109 of file 3level.h.