nxt_aligned(64) =
{
NXT_LVLHSH_DEFAULT,
- 0,
njs_event_hash_test,
njs_lvlhsh_alloc,
njs_lvlhsh_free,
nxt_aligned(64) =
{
NXT_LVLHSH_DEFAULT,
- NXT_LVLHSH_BATCH_ALLOC,
njs_extern_hash_test,
njs_lvlhsh_alloc,
njs_lvlhsh_free,
nxt_aligned(64) =
{
NXT_LVLHSH_DEFAULT,
- NXT_LVLHSH_BATCH_ALLOC,
njs_extern_value_hash_test,
njs_lvlhsh_alloc,
njs_lvlhsh_free,
nxt_aligned(64) =
{
NXT_LVLHSH_DEFAULT,
- 0,
njs_keyword_hash_test,
njs_lvlhsh_alloc,
njs_lvlhsh_free,
nxt_aligned(64) =
{
NXT_LVLHSH_DEFAULT,
- 0,
njs_module_hash_test,
njs_lvlhsh_alloc,
njs_lvlhsh_free,
nxt_aligned(64) =
{
NXT_LVLHSH_DEFAULT,
- 0,
njs_object_hash_test,
njs_lvlhsh_alloc,
njs_lvlhsh_free,
njs_host_event_t event);
static nxt_int_t lvlhsh_key_test(nxt_lvlhsh_query_t *lhq, void *data);
-static void *lvlhsh_pool_alloc(void *pool, size_t size, nxt_uint_t nalloc);
+static void *lvlhsh_pool_alloc(void *pool, size_t size);
static void lvlhsh_pool_free(void *pool, void *p, size_t size);
static const nxt_lvlhsh_proto_t lvlhsh_proto nxt_aligned(64) = {
NXT_LVLHSH_LARGE_SLAB,
- 0,
lvlhsh_key_test,
lvlhsh_pool_alloc,
lvlhsh_pool_free,
static void *
-lvlhsh_pool_alloc(void *pool, size_t size, nxt_uint_t nalloc)
+lvlhsh_pool_alloc(void *pool, size_t size)
{
return nxt_mp_align(pool, size, size);
}
nxt_aligned(64) =
{
NXT_LVLHSH_DEFAULT,
- 0,
njs_values_hash_test,
njs_lvlhsh_alloc,
njs_lvlhsh_free,
nxt_aligned(64) =
{
NXT_LVLHSH_DEFAULT,
- 0,
njs_variables_hash_test,
njs_lvlhsh_alloc,
njs_lvlhsh_free,
nxt_aligned(64) =
{
NXT_LVLHSH_DEFAULT,
- 0,
njs_reference_hash_test,
njs_lvlhsh_alloc,
njs_lvlhsh_free,
void *
-njs_lvlhsh_alloc(void *data, size_t size, nxt_uint_t nalloc)
+njs_lvlhsh_alloc(void *data, size_t size)
{
return nxt_mp_align(data, size, size);
}
nxt_array_t *njs_vm_backtrace(njs_vm_t *vm);
-void *njs_lvlhsh_alloc(void *data, size_t size, nxt_uint_t nalloc);
+void *njs_lvlhsh_alloc(void *data, size_t size);
void njs_lvlhsh_free(void *data, void *p, size_t size);
njs_array_t * njs_value_enumerate(njs_vm_t *vm, const njs_value_t *value,
static void *
-lvlhsh_unit_test_pool_alloc(void *pool, size_t size, nxt_uint_t nalloc)
+lvlhsh_unit_test_pool_alloc(void *pool, size_t size)
{
return nxt_mp_align(pool, size, size);
}
static const nxt_lvlhsh_proto_t lvlhsh_proto nxt_aligned(64) = {
NXT_LVLHSH_LARGE_SLAB,
- 0,
lvlhsh_unit_test_key_test,
lvlhsh_unit_test_pool_alloc,
lvlhsh_unit_test_pool_free,
{
uint32_t *bucket;
- bucket = lhq->proto->alloc(lhq->pool, nxt_lvlhsh_bucket_size(lhq->proto),
- lhq->proto->nalloc);
+ bucket = lhq->proto->alloc(lhq->pool, nxt_lvlhsh_bucket_size(lhq->proto));
if (nxt_fast_path(bucket != NULL)) {
proto = lhq->proto;
size = nxt_lvlhsh_level_size(proto, nlvl);
- lvl = proto->alloc(lhq->pool, size * (sizeof(void *)), proto->nalloc);
+ lvl = proto->alloc(lhq->pool, size * (sizeof(void *)));
if (nxt_slow_path(lvl == NULL)) {
return NXT_ERROR;
typedef struct nxt_lvlhsh_query_s nxt_lvlhsh_query_t;
typedef nxt_int_t (*nxt_lvlhsh_test_t)(nxt_lvlhsh_query_t *lhq, void *data);
-typedef void *(*nxt_lvlhsh_alloc_t)(void *ctx, size_t size, nxt_uint_t nalloc);
+typedef void *(*nxt_lvlhsh_alloc_t)(void *ctx, size_t size);
typedef void (*nxt_lvlhsh_free_t)(void *ctx, void *p, size_t size);
#define NXT_LVLHSH_DEFAULT_BUCKET_SIZE 128
#define NXT_LVLHSH_ENTRY_SIZE 3
-#define NXT_LVLHSH_BATCH_ALLOC 16
/* 3 is shift of 64-bit pointer. */
#define NXT_LVLHSH_MEMALIGN_SHIFT (NXT_MAX_MEMALIGN_SHIFT - 3)
#define NXT_LVLHSH_DEFAULT_BUCKET_SIZE 64
#define NXT_LVLHSH_ENTRY_SIZE 2
-#define NXT_LVLHSH_BATCH_ALLOC 8
/* 2 is shift of 32-bit pointer. */
#define NXT_LVLHSH_MEMALIGN_SHIFT (NXT_MAX_MEMALIGN_SHIFT - 2)
uint32_t bucket_size;
uint32_t bucket_mask;
uint8_t shift[8];
- uint32_t nalloc;
nxt_lvlhsh_test_t test;
nxt_lvlhsh_alloc_t alloc;
/* The maximum allowed aligned shift. */
uint32_t max_shift;
- uint32_t nalloc;
} nxt_lvlhsh_ctx_t;
static void *
-lvlhsh_unit_test_pool_alloc(void *pool, size_t size, nxt_uint_t nalloc)
+lvlhsh_unit_test_pool_alloc(void *pool, size_t size)
{
return nxt_mp_align(pool, size, size);
}
static const nxt_lvlhsh_proto_t lvlhsh_proto nxt_aligned(64) = {
NXT_LVLHSH_LARGE_SLAB,
- 0,
lvlhsh_unit_test_key_test,
lvlhsh_unit_test_pool_alloc,
lvlhsh_unit_test_pool_free,