nxt_mp.c (2078:0996dd223cdd) nxt_mp.c (2139:99d792169ffb)
1
2/*
3 * Copyright (C) Igor Sysoev
4 * Copyright (C) NGINX, Inc.
5 */
6
7#include <nxt_main.h>
8

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

150static void *nxt_mp_get_small(nxt_mp_t *mp, nxt_queue_t *pages, size_t size);
151static nxt_mp_page_t *nxt_mp_alloc_page(nxt_mp_t *mp);
152static nxt_mp_block_t *nxt_mp_alloc_cluster(nxt_mp_t *mp);
153#endif
154static void *nxt_mp_alloc_large(nxt_mp_t *mp, size_t alignment, size_t size,
155 nxt_bool_t freeable);
156static intptr_t nxt_mp_rbtree_compare(nxt_rbtree_node_t *node1,
157 nxt_rbtree_node_t *node2);
1
2/*
3 * Copyright (C) Igor Sysoev
4 * Copyright (C) NGINX, Inc.
5 */
6
7#include <nxt_main.h>
8

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

150static void *nxt_mp_get_small(nxt_mp_t *mp, nxt_queue_t *pages, size_t size);
151static nxt_mp_page_t *nxt_mp_alloc_page(nxt_mp_t *mp);
152static nxt_mp_block_t *nxt_mp_alloc_cluster(nxt_mp_t *mp);
153#endif
154static void *nxt_mp_alloc_large(nxt_mp_t *mp, size_t alignment, size_t size,
155 nxt_bool_t freeable);
156static intptr_t nxt_mp_rbtree_compare(nxt_rbtree_node_t *node1,
157 nxt_rbtree_node_t *node2);
158static nxt_mp_block_t *nxt_mp_find_block(nxt_rbtree_t *tree, u_char *p);
158static nxt_mp_block_t *nxt_mp_find_block(nxt_rbtree_t *tree, const u_char *p);
159static const char *nxt_mp_chunk_free(nxt_mp_t *mp, nxt_mp_block_t *cluster,
160 u_char *p);
161
162
163#if (NXT_HAVE_BUILTIN_CLZ)
164
165#define nxt_lg2(value) \
166 (31 - __builtin_clz(value))

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

825 err = "freed pointer is out of pool: %p";
826 }
827
828 nxt_thread_log_alert(err, p);
829}
830
831
832static nxt_mp_block_t *
159static const char *nxt_mp_chunk_free(nxt_mp_t *mp, nxt_mp_block_t *cluster,
160 u_char *p);
161
162
163#if (NXT_HAVE_BUILTIN_CLZ)
164
165#define nxt_lg2(value) \
166 (31 - __builtin_clz(value))

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

825 err = "freed pointer is out of pool: %p";
826 }
827
828 nxt_thread_log_alert(err, p);
829}
830
831
832static nxt_mp_block_t *
833nxt_mp_find_block(nxt_rbtree_t *tree, u_char *p)
833nxt_mp_find_block(nxt_rbtree_t *tree, const u_char *p)
834{
835 nxt_mp_block_t *block;
836 nxt_rbtree_node_t *node, *sentinel;
837
838 node = nxt_rbtree_root(tree);
839 sentinel = nxt_rbtree_sentinel(tree);
840
841 while (node != sentinel) {

--- 234 unchanged lines hidden ---
834{
835 nxt_mp_block_t *block;
836 nxt_rbtree_node_t *node, *sentinel;
837
838 node = nxt_rbtree_root(tree);
839 sentinel = nxt_rbtree_sentinel(tree);
840
841 while (node != sentinel) {

--- 234 unchanged lines hidden ---