Classes | Macros | Functions | Variables
fs-fd-hash-inl.h File Reference
#include "uv.h"
#include "internal.h"
Include dependency graph for fs-fd-hash-inl.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  uv__fd_hash_bucket_s
 
struct  uv__fd_hash_entry_group_s
 
struct  uv__fd_hash_entry_s
 
struct  uv__fd_info_s
 

Macros

#define FIND_COMMON_VARIABLES
 
#define FIND_IN_BUCKET_PTR()
 
#define FIND_IN_GROUP_PTR(group_size)
 
#define UV__FD_HASH_GROUP_SIZE   16
 
#define UV__FD_HASH_SIZE   256
 

Functions

static INLINE void uv__fd_hash_add (int fd, struct uv__fd_info_s *info)
 
static INLINE int uv__fd_hash_get (int fd, struct uv__fd_info_s *info)
 
static INLINE void uv__fd_hash_init (void)
 
static INLINE int uv__fd_hash_remove (int fd, struct uv__fd_info_s *info)
 

Variables

static struct uv__fd_hash_bucket_s uv__fd_hash [UV__FD_HASH_SIZE]
 
static struct uv__fd_hash_entry_group_s uv__fd_hash_entry_initial [UV__FD_HASH_SIZE *UV__FD_HASH_GROUP_SIZE]
 
static uv_mutex_t uv__fd_hash_mutex
 

Macro Definition Documentation

◆ FIND_COMMON_VARIABLES

#define FIND_COMMON_VARIABLES
Value:
unsigned i; \
unsigned bucket = fd % ARRAY_SIZE(uv__fd_hash); \
struct uv__fd_hash_entry_s* entry_ptr = NULL; \
struct uv__fd_hash_entry_group_s* group_ptr; \
struct uv__fd_hash_bucket_s* bucket_ptr = &uv__fd_hash[bucket];

Definition at line 70 of file fs-fd-hash-inl.h.

◆ FIND_IN_BUCKET_PTR

#define FIND_IN_BUCKET_PTR ( )
Value:
do { \
size_t first_group_size = bucket_ptr->size % UV__FD_HASH_GROUP_SIZE; \
if (bucket_ptr->size != 0 && first_group_size == 0) \
first_group_size = UV__FD_HASH_GROUP_SIZE; \
group_ptr = bucket_ptr->data; \
FIND_IN_GROUP_PTR(first_group_size); \
for (group_ptr = group_ptr->next; \
group_ptr != NULL && entry_ptr == NULL; \
group_ptr = group_ptr->next) \
FIND_IN_GROUP_PTR(UV__FD_HASH_GROUP_SIZE); \
} while (0)

Definition at line 87 of file fs-fd-hash-inl.h.

◆ FIND_IN_GROUP_PTR

#define FIND_IN_GROUP_PTR (   group_size)
Value:
do { \
for (i = 0; i < group_size; ++i) { \
if (group_ptr->entries[i].fd == fd) { \
entry_ptr = &group_ptr->entries[i]; \
break; \
} \
} \
} while (0)

Definition at line 77 of file fs-fd-hash-inl.h.

◆ UV__FD_HASH_GROUP_SIZE

#define UV__FD_HASH_GROUP_SIZE   16

Definition at line 22 of file fs-fd-hash-inl.h.

◆ UV__FD_HASH_SIZE

#define UV__FD_HASH_SIZE   256

Definition at line 21 of file fs-fd-hash-inl.h.

Function Documentation

◆ uv__fd_hash_add()

static INLINE void uv__fd_hash_add ( int  fd,
struct uv__fd_info_s info 
)
static

Definition at line 115 of file fs-fd-hash-inl.h.

◆ uv__fd_hash_get()

static INLINE int uv__fd_hash_get ( int  fd,
struct uv__fd_info_s info 
)
static

Definition at line 100 of file fs-fd-hash-inl.h.

◆ uv__fd_hash_init()

static INLINE void uv__fd_hash_init ( void  )
static

Definition at line 55 of file fs-fd-hash-inl.h.

◆ uv__fd_hash_remove()

static INLINE int uv__fd_hash_remove ( int  fd,
struct uv__fd_info_s info 
)
static

Definition at line 145 of file fs-fd-hash-inl.h.

Variable Documentation

◆ uv__fd_hash

struct uv__fd_hash_bucket_s uv__fd_hash[UV__FD_HASH_SIZE]
static

Definition at line 52 of file fs-fd-hash-inl.h.

◆ uv__fd_hash_entry_initial

struct uv__fd_hash_entry_group_s uv__fd_hash_entry_initial[UV__FD_HASH_SIZE *UV__FD_HASH_GROUP_SIZE]
static

Definition at line 50 of file fs-fd-hash-inl.h.

◆ uv__fd_hash_mutex

uv_mutex_t uv__fd_hash_mutex
static

Definition at line 48 of file fs-fd-hash-inl.h.

ARRAY_SIZE
#define ARRAY_SIZE(array)
Definition: bloaty.cc:101
uv__fd_hash
static struct uv__fd_hash_bucket_s uv__fd_hash[UV__FD_HASH_SIZE]
Definition: fs-fd-hash-inl.h:52
uv__fd_hash_bucket_s
Definition: fs-fd-hash-inl.h:42
uv__fd_hash_entry_group_s
Definition: fs-fd-hash-inl.h:37
uv__fd_hash_entry_s
Definition: fs-fd-hash-inl.h:32
UV__FD_HASH_GROUP_SIZE
#define UV__FD_HASH_GROUP_SIZE
Definition: fs-fd-hash-inl.h:22
i
uint64_t i
Definition: abseil-cpp/absl/container/btree_benchmark.cc:230


grpc
Author(s):
autogenerated on Fri May 16 2025 03:01:13