nxt_lvlhsh_test.c (840:500c3525e10e) nxt_lvlhsh_test.c (1563:d32bc428f46b)
1
2/*
3 * Copyright (C) Igor Sysoev
4 * Copyright (C) NGINX, Inc.
5 */
6
7#include <nxt_main.h>
8#include "nxt_tests.h"

--- 5 unchanged lines hidden (view full) ---

14 if (*(uintptr_t *) lhq->key.start == (uintptr_t) data) {
15 return NXT_OK;
16 }
17
18 return NXT_DECLINED;
19}
20
21
1
2/*
3 * Copyright (C) Igor Sysoev
4 * Copyright (C) NGINX, Inc.
5 */
6
7#include <nxt_main.h>
8#include "nxt_tests.h"

--- 5 unchanged lines hidden (view full) ---

14 if (*(uintptr_t *) lhq->key.start == (uintptr_t) data) {
15 return NXT_OK;
16 }
17
18 return NXT_DECLINED;
19}
20
21
22static void *
23nxt_lvlhsh_test_pool_alloc(void *pool, size_t size)
24{
25 return nxt_mp_align(pool, size, size);
26}
27
28
29static void
30nxt_lvlhsh_test_pool_free(void *pool, void *p)
31{
32 nxt_mp_free(pool, p);
33}
34
35
36static const nxt_lvlhsh_proto_t malloc_proto nxt_aligned(64) = {
37 //NXT_LVLHSH_LARGE_MEMALIGN,
38 NXT_LVLHSH_DEFAULT,
39 nxt_lvlhsh_test_key_test,
40 nxt_lvlhsh_alloc,
41 nxt_lvlhsh_free,
42};
43
44static const nxt_lvlhsh_proto_t pool_proto nxt_aligned(64) = {
45 NXT_LVLHSH_LARGE_SLAB,
46 nxt_lvlhsh_test_key_test,
22static const nxt_lvlhsh_proto_t malloc_proto nxt_aligned(64) = {
23 //NXT_LVLHSH_LARGE_MEMALIGN,
24 NXT_LVLHSH_DEFAULT,
25 nxt_lvlhsh_test_key_test,
26 nxt_lvlhsh_alloc,
27 nxt_lvlhsh_free,
28};
29
30static const nxt_lvlhsh_proto_t pool_proto nxt_aligned(64) = {
31 NXT_LVLHSH_LARGE_SLAB,
32 nxt_lvlhsh_test_key_test,
47 nxt_lvlhsh_test_pool_alloc,
48 nxt_lvlhsh_test_pool_free,
33 nxt_mp_lvlhsh_alloc,
34 nxt_mp_lvlhsh_free,
49};
50
51
52static nxt_int_t
53nxt_lvlhsh_test_add(nxt_lvlhsh_t *lh, const nxt_lvlhsh_proto_t *proto,
54 void *pool, uintptr_t key)
55{
56 nxt_lvlhsh_query_t lhq;

--- 221 unchanged lines hidden ---
35};
36
37
38static nxt_int_t
39nxt_lvlhsh_test_add(nxt_lvlhsh_t *lh, const nxt_lvlhsh_proto_t *proto,
40 void *pool, uintptr_t key)
41{
42 nxt_lvlhsh_query_t lhq;

--- 221 unchanged lines hidden ---