GRPC Core  18.0.0
Data Structures | Macros | Typedefs | Functions | Variables
metadata.cc File Reference
#include <grpc/support/port_platform.h>
#include "src/core/lib/transport/metadata.h"
#include <assert.h>
#include <inttypes.h>
#include <stddef.h>
#include <string.h>
#include <grpc/compression.h>
#include <grpc/grpc.h>
#include <grpc/support/alloc.h>
#include <grpc/support/atm.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
#include <grpc/support/time.h>
#include "src/core/lib/gpr/murmur_hash.h"
#include "src/core/lib/iomgr/iomgr_internal.h"
#include "src/core/lib/profiling/timers.h"
#include "src/core/lib/slice/slice_internal.h"
#include "src/core/lib/slice/slice_string_helpers.h"
#include "src/core/lib/transport/static_metadata.h"

Data Structures

struct  mdtab_shard
 

Macros

#define DEBUG_ARGS   , const char *file, int line
 
#define FWD_DEBUG_ARGS   file, line
 
#define INITIAL_SHARD_CAPACITY   8
 
#define LOG2_SHARD_COUNT   4
 
#define SHARD_COUNT   ((size_t)(1 << LOG2_SHARD_COUNT))
 
#define TABLE_IDX(hash, capacity)   (((hash) >> (LOG2_SHARD_COUNT)) % (capacity))
 
#define SHARD_IDX(hash)   ((hash) & ((1 << (LOG2_SHARD_COUNT)) - 1))
 

Typedefs

typedef struct mdtab_shard mdtab_shard
 

Functions

void grpc_mdelem_trace_ref (void *md, const grpc_slice &key, const grpc_slice &value, intptr_t refcnt, const char *file, int line)
 
void grpc_mdelem_trace_unref (void *md, const grpc_slice &key, const grpc_slice &value, intptr_t refcnt, const char *file, int line)
 
void grpc_mdctx_global_init (void)
 
void grpc_mdctx_global_shutdown ()
 
grpc_mdelem grpc_mdelem_create (const grpc_slice &key, const grpc_slice &value, grpc_mdelem_data *compatible_external_backing_store)
 
grpc_mdelem grpc_mdelem_create (const grpc_core::StaticMetadataSlice &key, const grpc_slice &value, grpc_mdelem_data *compatible_external_backing_store)
 
grpc_mdelem grpc_mdelem_from_slices (const grpc_slice &key, const grpc_slice &value)
 
grpc_mdelem grpc_mdelem_from_slices (const grpc_core::StaticMetadataSlice &key, const grpc_slice &value)
 
grpc_mdelem grpc_mdelem_from_slices (const grpc_core::StaticMetadataSlice &key, const grpc_core::StaticMetadataSlice &value)
 
grpc_mdelem grpc_mdelem_from_slices (const grpc_core::StaticMetadataSlice &key, const grpc_core::ManagedMemorySlice &value)
 
grpc_mdelem grpc_mdelem_from_slices (const grpc_core::ManagedMemorySlice &key, const grpc_core::ManagedMemorySlice &value)
 
grpc_mdelem grpc_mdelem_from_grpc_metadata (grpc_metadata *metadata)
 
void * grpc_mdelem_get_user_data (grpc_mdelem md, void(*destroy_func)(void *))
 
void * grpc_mdelem_set_user_data (grpc_mdelem md, void(*destroy_func)(void *), void *data)
 
bool grpc_mdelem_eq (grpc_mdelem a, grpc_mdelem b)
 
void grpc_mdelem_do_unref (grpc_mdelem gmd, const char *file, int line)
 
void grpc_mdelem_on_final_unref (grpc_mdelem_data_storage storage, void *ptr, uint32_t hash, const char *file, int line)
 

Variables

grpc_core::DebugOnlyTraceFlag grpc_trace_metadata (false, "metadata")
 

Macro Definition Documentation

◆ DEBUG_ARGS

#define DEBUG_ARGS   , const char *file, int line

◆ FWD_DEBUG_ARGS

#define FWD_DEBUG_ARGS   file, line

◆ INITIAL_SHARD_CAPACITY

#define INITIAL_SHARD_CAPACITY   8

◆ LOG2_SHARD_COUNT

#define LOG2_SHARD_COUNT   4

◆ SHARD_COUNT

#define SHARD_COUNT   ((size_t)(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

◆ mdtab_shard

typedef struct mdtab_shard mdtab_shard

Function Documentation

◆ grpc_mdctx_global_init()

void grpc_mdctx_global_init ( void  )

◆ grpc_mdctx_global_shutdown()

void grpc_mdctx_global_shutdown ( )

◆ grpc_mdelem_create() [1/2]

grpc_mdelem grpc_mdelem_create ( const grpc_core::StaticMetadataSlice key,
const grpc_slice value,
grpc_mdelem_data compatible_external_backing_store 
)

◆ grpc_mdelem_create() [2/2]

grpc_mdelem grpc_mdelem_create ( const grpc_slice key,
const grpc_slice value,
grpc_mdelem_data compatible_external_backing_store 
)

◆ grpc_mdelem_do_unref()

void grpc_mdelem_do_unref ( grpc_mdelem  gmd,
const char *  file,
int  line 
)

◆ grpc_mdelem_eq()

bool grpc_mdelem_eq ( grpc_mdelem  a,
grpc_mdelem  b 
)

◆ grpc_mdelem_from_grpc_metadata()

grpc_mdelem grpc_mdelem_from_grpc_metadata ( grpc_metadata metadata)

◆ grpc_mdelem_from_slices() [1/5]

grpc_mdelem grpc_mdelem_from_slices ( const grpc_core::ManagedMemorySlice key,
const grpc_core::ManagedMemorySlice value 
)

◆ grpc_mdelem_from_slices() [2/5]

grpc_mdelem grpc_mdelem_from_slices ( const grpc_core::StaticMetadataSlice key,
const grpc_core::ManagedMemorySlice value 
)

◆ grpc_mdelem_from_slices() [3/5]

grpc_mdelem grpc_mdelem_from_slices ( const grpc_core::StaticMetadataSlice key,
const grpc_core::StaticMetadataSlice value 
)

◆ grpc_mdelem_from_slices() [4/5]

grpc_mdelem grpc_mdelem_from_slices ( const grpc_core::StaticMetadataSlice key,
const grpc_slice value 
)

◆ grpc_mdelem_from_slices() [5/5]

grpc_mdelem grpc_mdelem_from_slices ( const grpc_slice key,
const grpc_slice value 
)

◆ grpc_mdelem_get_user_data()

void* grpc_mdelem_get_user_data ( grpc_mdelem  md,
void(*)(void *)  destroy_func 
)

◆ grpc_mdelem_on_final_unref()

void grpc_mdelem_on_final_unref ( grpc_mdelem_data_storage  storage,
void *  ptr,
uint32_t  hash,
const char *  file,
int  line 
)

◆ grpc_mdelem_set_user_data()

void* grpc_mdelem_set_user_data ( grpc_mdelem  md,
void(*)(void *)  destroy_func,
void *  data 
)

◆ grpc_mdelem_trace_ref()

void grpc_mdelem_trace_ref ( void *  md,
const grpc_slice key,
const grpc_slice value,
intptr_t  refcnt,
const char *  file,
int  line 
)

◆ grpc_mdelem_trace_unref()

void grpc_mdelem_trace_unref ( void *  md,
const grpc_slice key,
const grpc_slice value,
intptr_t  refcnt,
const char *  file,
int  line 
)

Variable Documentation

◆ grpc_trace_metadata

grpc_core::DebugOnlyTraceFlag grpc_trace_metadata(false, "metadata") ( false  ,
"metadata"   
)