Back to index

lightning-sunbird  0.9+nobinonly
Classes | Defines | Typedefs | Enumerations | Functions | Variables
jsdhash.h File Reference
#include "jstypes.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  JSDHashEntryHdr
struct  JSDHashTable
struct  JSDHashTableOps
struct  JSDHashEntryStub

Defines

#define JS_DHASH_FASTCALL
#define JS_DHASH_SIZE_LIMIT   JS_BIT(24)
#define JS_DHASH_MIN_SIZE   16
#define JS_DHASH_BITS   32
#define JS_DHASH_GOLDEN_RATIO   0x9E3779B9U
#define JS_DHASH_ENTRY_IS_FREE(entry)   ((entry)->keyHash == 0)
#define JS_DHASH_ENTRY_IS_BUSY(entry)   (!JS_DHASH_ENTRY_IS_FREE(entry))
#define JS_DHASH_ENTRY_IS_LIVE(entry)   ((entry)->keyHash >= 2)
#define JS_DHASH_TABLE_SIZE(table)   JS_BIT(JS_DHASH_BITS - (table)->hashShift)
#define JS_DHASH_MIN_ALPHA(table, k)

Typedefs

typedef uint32 JSDHashNumber
typedef struct JSDHashEntryHdr
typedef struct JSDHashEntryStub
typedef struct JSDHashTable
typedef struct JSDHashTableOps
typedef void *(* JS_DLL_CALLBACK )(JSDHashTable *table, uint32 nbytes)
typedef enum JSDHashOperator JSDHashOperator

Enumerations

enum  JSDHashOperator {
  JS_DHASH_LOOKUP = 0, JS_DHASH_ADD = 1, JS_DHASH_REMOVE = 2, JS_DHASH_NEXT = 0,
  JS_DHASH_STOP = 1
}

Functions

 JS_PUBLIC_API (void *) JS_DHashAllocTable(JSDHashTable *table
 JS_PUBLIC_API (void) JS_DHashFreeTable(JSDHashTable *table
 JS_PUBLIC_API (JSDHashNumber) JS_DHashStringKey(JSDHashTable *table
 JS_PUBLIC_API (const void *) JS_DHashGetKeyStub(JSDHashTable *table
 JS_PUBLIC_API (JSBool) JS_DHashMatchEntryStub(JSDHashTable *table
 JS_PUBLIC_API (const JSDHashTableOps *) JS_DHashGetStubOps(void)
 JS_PUBLIC_API (JSDHashTable *) JS_NewDHashTable(const JSDHashTableOps *ops
 JS_PUBLIC_API (JSDHashEntryHdr *) JS_DHASH_FASTCALL JS_DHashTableOperate(JSDHashTable *table

Variables

uint32 nbytes
voidptr
const voidkey
JSDHashEntryHdrentry
const JSDHashEntryHdrfrom
const JSDHashEntryHdr
JSDHashEntryHdr
to
voiddata
void uint32 entrySize
void uint32 uint32 capacity
const JSDHashTableOpsops
float maxAlpha
float float minAlpha
const void JSDHashOperator op
JSDHashEnumerator etor
JSDHashEnumerator voidarg

Class Documentation

struct JSDHashTable

Definition at line 193 of file jsdhash.h.

Collaboration diagram for JSDHashTable:
Class Members
void * data
uint32 entryCount
uint32 entrySize
char * entryStore
uint32 generation
int16 hashShift
uint8 maxAlphaFrac
uint8 minAlphaFrac
const JSDHashTableOps * ops
uint32 removedCount
struct JSDHashTableOps

Definition at line 338 of file jsdhash.h.

Class Members
JSDHashAllocTable allocTable
Clear
JSDHashClearEntry clearEntry
JSDHashFinalize finalize
JSDHashFreeTable freeTable
JSDHashGetKey getKey
GetKey
Hash
HashIIDPtrKey
JSDHashHashKey hashKey
HashNativeKey
JSDHashInitEntry initEntry
JS_DHashAllocTable
JS_DHashClearEntryStub
JS_DHashFreeTable
JS_DHashGetKeyStub
JS_DHashMoveEntryStub
Match
JSDHashMatchEntry matchEntry
MatchIIDPtrKey
JSDHashMoveEntry moveEntry
struct JSDHashEntryStub

Definition at line 366 of file jsdhash.h.

Class Members
JSDHashEntryHdr hdr
const void * key

Define Documentation

Definition at line 75 of file jsdhash.h.

Definition at line 118 of file jsdhash.h.

Definition at line 117 of file jsdhash.h.

Definition at line 119 of file jsdhash.h.

Definition at line 53 of file jsdhash.h.

#define JS_DHASH_GOLDEN_RATIO   0x9E3779B9U

Definition at line 76 of file jsdhash.h.

#define JS_DHASH_MIN_ALPHA (   table,
 
)
Value:
((float)((table)->entrySize / sizeof(void *) - 1)                         \
     / ((table)->entrySize / sizeof(void *) + (k)))

Definition at line 454 of file jsdhash.h.

Definition at line 66 of file jsdhash.h.

Definition at line 62 of file jsdhash.h.

#define JS_DHASH_TABLE_SIZE (   table)    JS_BIT(JS_DHASH_BITS - (table)->hashShift)

Definition at line 232 of file jsdhash.h.


Typedef Documentation

Definition at line 240 of file jsdhash.h.

typedef struct JSDHashEntryHdr

Definition at line 80 of file jsdhash.h.

typedef struct JSDHashEntryStub

Definition at line 81 of file jsdhash.h.

Definition at line 79 of file jsdhash.h.

typedef struct JSDHashTable

Definition at line 82 of file jsdhash.h.

typedef struct JSDHashTableOps

Definition at line 83 of file jsdhash.h.


Enumeration Type Documentation

Enumerator:
JS_DHASH_LOOKUP 
JS_DHASH_ADD 
JS_DHASH_REMOVE 
JS_DHASH_NEXT 
JS_DHASH_STOP 

Definition at line 473 of file jsdhash.h.

                             {
    JS_DHASH_LOOKUP = 0,        /* lookup entry */
    JS_DHASH_ADD = 1,           /* add entry */
    JS_DHASH_REMOVE = 2,        /* remove entry, or enumerator says remove */
    JS_DHASH_NEXT = 0,          /* enumerator says continue */
    JS_DHASH_STOP = 1           /* enumerator says stop */
} JSDHashOperator;

Function Documentation

Definition at line 58 of file jslog2.c.

{
    JSIntn log2;

    JS_FLOOR_LOG2(log2, n);
    return log2;
}
JS_PUBLIC_API ( JSDHashTable ) const

Variable Documentation

JSDHashEnumerator void* arg

Definition at line 570 of file jsdhash.h.

Definition at line 416 of file jsdhash.h.

Definition at line 416 of file jsdhash.h.

Definition at line 372 of file jsdhash.h.

Definition at line 416 of file jsdhash.h.

JSDHashEnumerator etor

Definition at line 570 of file jsdhash.h.

Definition at line 389 of file jsdhash.h.

Definition at line 363 of file jsdhash.h.

float maxAlpha

Definition at line 446 of file jsdhash.h.

float float minAlpha

Definition at line 446 of file jsdhash.h.

Definition at line 357 of file jsdhash.h.

Definition at line 512 of file jsdhash.h.

Definition at line 433 of file jsdhash.h.

Definition at line 360 of file jsdhash.h.

Definition at line 389 of file jsdhash.h.