Macro in stdx_hpool.h

X_HPOOL_VERSION_MAJOR

#define X_HPOOL_VERSION_MAJOR 1
Macro in stdx_hpool.h

X_HPOOL_VERSION_MINOR

#define X_HPOOL_VERSION_MINOR 0
Macro in stdx_hpool.h

X_HPOOL_VERSION_PATCH

#define X_HPOOL_VERSION_PATCH 0
Macro in stdx_hpool.h

X_HPOOL_NULL_INDEX

#define X_HPOOL_NULL_INDEX 0xFFFFFFFFu
Struct in stdx_hpool.h

XHandle

typedef struct XHandle{
  uint32_t index;
  uint32_t version;
}XHandle;
Typedef in stdx_hpool.h

XHPoolCtorFn

typedef void(*XHPoolCtorFn)(void *user, void *item);
Typedef in stdx_hpool.h

XHPoolDtorFn

typedef void(*XHPoolDtorFn)(void *user, void *item);
Struct in stdx_hpool.h

XHPoolConfig

typedef struct XHPoolConfig{
  uint32_t page_capacity;
  uint32_t initial_pages;
}XHPoolConfig;
Struct in stdx_hpool.h

XHPoolIter

typedef struct XHPoolIter{
  uint32_t alive_pos;
}XHPoolIter;
Struct in stdx_hpool.h

XHPool

typedef struct XHPool{
  size_t item_size;
  uint32_t page_capacity;
  uint32_t page_shift;
  uint32_t page_mask;
  void **pages;
  uint32_t page_count;
  uint32_t page_cap;
  uint32_t free_head;
  uint32_t next_index;
  uint32_t *alive;
  uint32_t alive_count;
  uint32_t alive_cap;
  XHPoolCtorFn ctor;
  XHPoolDtorFn dtor;
  void *user;
}XHPool;
Function in stdx_hpool.h

x_hpool_page_capacity

X_HPOOL_API uint32_t x_hpool_page_capacity(XHPool *p);
Function in stdx_hpool.h

x_hpool_capacity

X_HPOOL_API uint32_t x_hpool_capacity(XHPool *p);
Function in stdx_hpool.h

x_hpool_alive_count

X_HPOOL_API uint32_t x_hpool_alive_count(XHPool *p);
Function in stdx_hpool.h

x_hpool_get_unchecked

X_HPOOL_API void * x_hpool_get_unchecked(
 XHPool *p,
 uint32_t index
);
Macro in stdx_hpool.h

X_HPOOL_FOREACH

#define X_HPOOL_FOREACH(pHPool, Type, itVar, hVar, ptrVar) \
for(XHPoolIter itVar={0},*x__hpool_once_##itVar=&(itVar);x__hpool_once_##itVar!=NULL;x__hpool_once_##itVar=NULL)\
for((ptrVar)=(Type *)x_hpool_iter_begin((pHPool),&(itVar),&(hVar));(ptrVar)!=NULL;(ptrVar)=(Type *)x_hpool_iter_next((pHPool),&(itVar),&(hVar)))
Macro in stdx_hpool.h

X_HPOOL_ALLOC

Internal macro for allocating memory. To override how this header allocates memory, define this macro with a different implementation before including this header.

#define X_HPOOL_ALLOC(sz) malloc(sz)

Parameters

sz
The size of memory to alloc.
Macro in stdx_hpool.h

X_HPOOL_REALLOC

Internal macro for resizing memory. To override how this header resizes memory, define this macro with a different implementation before including this header.

#define X_HPOOL_REALLOC(p, sz) realloc((p), (sz))

Parameters

sz
The size of memory to resize.
Macro in stdx_hpool.h

X_HPOOL_FREE

Internal macro for freeing memory. To override how this header frees memory, define this macro with a different implementation before including this header.

#define X_HPOOL_FREE(p) free(p)

Parameters

p
The address of memory region to free.
Struct in stdx_hpool.h

XHPoolSlotHeader

typedef struct XHPoolSlotHeader{
  uint32_t version;
  uint32_t next_free;
  uint32_t alive_pos;
  uint32_t flags;
}XHPoolSlotHeader;
Macro in stdx_hpool.h

X_POOL_SLOT_ALIVE

#define X_POOL_SLOT_ALIVE 1u
Function in stdx_hpool.h

x_hpool_page_index

X_HPOOL_API uint32_t x_hpool_page_index(
 const XHPool *p,
 uint32_t index
);
Function in stdx_hpool.h

x_hpool_slot_index

X_HPOOL_API uint32_t x_hpool_slot_index(
 const XHPool *p,
 uint32_t index
);
Function in stdx_hpool.h

x_hpool_slot_stride

X_HPOOL_API size_t x_hpool_slot_stride(const XHPool *p);
Function in stdx_hpool.h

x_hpool_page_base

X_HPOOL_API uint8_t * x_hpool_page_base(
 const XHPool *p,
 uint32_t page_index
);
Function in stdx_hpool.h

x_hpool_item_by_index

X_HPOOL_API void * x_hpool_item_by_index(
 const XHPool *p,
 uint32_t index
);
Function in stdx_hpool.h

x_hpool_ensure_pages_array

X_HPOOL_API int x_hpool_ensure_pages_array(
 XHPool *p,
 uint32_t want
);
Function in stdx_hpool.h

x_hpool_ensure_page_for_index

X_HPOOL_API int x_hpool_ensure_page_for_index(
 XHPool *p,
 uint32_t index
);
Function in stdx_hpool.h

x_hpool_alive_reserve

X_HPOOL_API int x_hpool_alive_reserve(
 XHPool *p,
 uint32_t want
);
Function in stdx_hpool.h

x_hpool_alive_add

X_HPOOL_API void x_hpool_alive_add(
 XHPool *p,
 uint32_t index
);
Function in stdx_hpool.h

x_hpool_alive_remove

X_HPOOL_API void x_hpool_alive_remove(
 XHPool *p,
 uint32_t index
);