GRPC C++  1.39.1
Data Structures | Namespaces | Macros | Typedefs | Functions | Variables
slice_intern.cc File Reference
#include <grpc/support/port_platform.h>
#include "src/core/lib/slice/slice_internal.h"
#include "src/core/lib/slice/slice_utils.h"
#include <inttypes.h>
#include <string.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include "src/core/lib/gpr/murmur_hash.h"
#include "src/core/lib/gprpp/sync.h"
#include "src/core/lib/iomgr/iomgr_internal.h"
#include "src/core/lib/profiling/timers.h"
#include "src/core/lib/slice/slice_string_helpers.h"
#include "src/core/lib/transport/static_metadata.h"

Data Structures

struct  slice_shard
 
struct  static_metadata_hash_ent
 

Namespaces

 grpc_core
 Round Robin Policy.
 

Macros

#define LOG2_SHARD_COUNT   5
 
#define SHARD_COUNT   (1 << LOG2_SHARD_COUNT)
 
#define INITIAL_SHARD_CAPACITY   8
 
#define TABLE_IDX(hash, capacity)   (((hash) >> LOG2_SHARD_COUNT) % (capacity))
 
#define SHARD_IDX(hash)   ((hash) & ((1 << LOG2_SHARD_COUNT) - 1))
 

Typedefs

typedef struct slice_shard slice_shard
 

Functions

uint32_t grpc_slice_default_hash_impl (grpc_slice s)
 
uint32_t grpc_static_slice_hash (grpc_slice s)
 
int grpc_static_slice_eq (grpc_slice a, grpc_slice b)
 
uint32_t grpc_slice_hash (grpc_slice s)
 
grpc_slice grpc_slice_maybe_static_intern (grpc_slice slice, bool *returned_slice_is_different)
 
grpc_slice grpc_slice_intern (grpc_slice slice)
 Intern a slice: More...
 
void grpc_test_only_set_slice_hash_seed (uint32_t seed)
 
void grpc_slice_intern_init (void)
 
void grpc_slice_intern_shutdown (void)
 

Variables

uint32_t grpc_static_metadata_hash_values [GRPC_STATIC_MDSTR_COUNT]
 
uint32_t grpc_core::g_hash_seed
 

Macro Definition Documentation

◆ INITIAL_SHARD_CAPACITY

#define INITIAL_SHARD_CAPACITY   8

◆ LOG2_SHARD_COUNT

#define LOG2_SHARD_COUNT   5

◆ SHARD_COUNT

#define SHARD_COUNT   (1 << LOG2_SHARD_COUNT)

◆ SHARD_IDX

#define SHARD_IDX (   hash)    ((hash) & ((1 << LOG2_SHARD_COUNT) - 1))

◆ TABLE_IDX

#define TABLE_IDX (   hash,
  capacity 
)    (((hash) >> LOG2_SHARD_COUNT) % (capacity))

Typedef Documentation

◆ slice_shard

typedef struct slice_shard slice_shard

Function Documentation

◆ grpc_slice_default_hash_impl()

uint32_t grpc_slice_default_hash_impl ( grpc_slice  s)

◆ grpc_slice_hash()

uint32_t grpc_slice_hash ( grpc_slice  s)

◆ grpc_slice_intern()

grpc_slice grpc_slice_intern ( grpc_slice  slice)

Intern a slice:

The return value for two invocations of this function with the same sequence of bytes is a slice which points to the same memory.

◆ grpc_slice_intern_init()

void grpc_slice_intern_init ( void  )

◆ grpc_slice_intern_shutdown()

void grpc_slice_intern_shutdown ( void  )

◆ grpc_slice_maybe_static_intern()

grpc_slice grpc_slice_maybe_static_intern ( grpc_slice  slice,
bool *  returned_slice_is_different 
)

◆ grpc_static_slice_eq()

int grpc_static_slice_eq ( grpc_slice  a,
grpc_slice  b 
)

◆ grpc_static_slice_hash()

uint32_t grpc_static_slice_hash ( grpc_slice  s)

◆ grpc_test_only_set_slice_hash_seed()

void grpc_test_only_set_slice_hash_seed ( uint32_t  seed)

Variable Documentation

◆ grpc_static_metadata_hash_values

uint32_t grpc_static_metadata_hash_values[GRPC_STATIC_MDSTR_COUNT]