Home
last modified time | relevance | path

Searched refs:size (Results 1 – 25 of 160) sorted by relevance

1234567

/unit/src/
H A Dnxt_malloc.h11 NXT_EXPORT void *nxt_malloc(size_t size)
13 NXT_EXPORT void *nxt_zalloc(size_t size)
15 NXT_EXPORT void *nxt_realloc(void *p, size_t size)
57 size = malloc_usable_size(p)
60 size = ((cutback) && size > 127 * 1024) ? size - 32 : size
82 size = malloc_usable_size(p)
84 #define nxt_malloc_cutback(cutback, size) argument
102 size = malloc_good_size(size)
104 #define nxt_malloc_cutback(cutback, size) argument
108 #define nxt_malloc_usable_size(p, size) argument
[all …]
H A Dnxt_malloc.c31 nxt_malloc(size_t size) in nxt_malloc() argument
35 p = malloc(size); in nxt_malloc()
50 nxt_zalloc(size_t size) in nxt_zalloc() argument
54 p = nxt_malloc(size); in nxt_zalloc()
57 nxt_memzero(p, size); in nxt_zalloc()
65 nxt_realloc(void *p, size_t size) in nxt_realloc() argument
76 n = realloc(p, size); in nxt_realloc()
96 return nxt_memalign(size, size); in nxt_lvlhsh_alloc()
157 p = memalign(alignment, size); in nxt_memalign()
198 if (nxt_fast_path(size <= 2048)) { in nxt_memalign()
[all …]
H A Dnxt_buf_pool.c11 nxt_buf_pool_mem_alloc(nxt_buf_pool_t *bp, size_t size) in nxt_buf_pool_mem_alloc() argument
34 if (size == 0 || size >= bp->size + bp->size / 4) { in nxt_buf_pool_mem_alloc()
35 size = bp->size; in nxt_buf_pool_mem_alloc()
74 if (size == 0 || size >= bp->size + bp->size / 4) { in nxt_buf_pool_file_alloc()
75 size = bp->size; in nxt_buf_pool_file_alloc()
114 if (size == 0 || size >= bp->size + bp->size / 4) { in nxt_buf_pool_mmap_alloc()
115 size = bp->size; in nxt_buf_pool_mmap_alloc()
118 b = nxt_buf_mmap_alloc(bp->mem_pool, size); in nxt_buf_pool_mmap_alloc()
134 size_t size; in nxt_buf_pool_free() local
138 size = nxt_buf_mem_size(&b->mem); in nxt_buf_pool_free()
[all …]
H A Dnxt_mem_zone.c139 size_t size);
223 size = 32; in nxt_mem_zone_pages()
233 size += 16; in nxt_mem_zone_pages()
297 size = 32; in nxt_mem_zone_slots_init()
319 slot[n].size = size; in nxt_mem_zone_slots_init()
465 size = nxt_next_highest_power_of_two(size); in nxt_mem_zone_align()
466 size = nxt_max(size, alignment); in nxt_mem_zone_align()
476 alignment, size, slot->size); in nxt_mem_zone_align()
508 size_t size) in nxt_mem_zone_alloc_small() argument
552 page->size = slot->size; in nxt_mem_zone_alloc_small()
[all …]
H A Dnxt_sendbuf.c21 size_t size, total; in nxt_sendbuf_mem_coalesce0() local
25 total = sb->size; in nxt_sendbuf_mem_coalesce0()
41 if (size != 0) { in nxt_sendbuf_mem_coalesce0()
95 total = sb->size; in nxt_sendbuf_mem_coalesce()
156 sb->size = total; in nxt_sendbuf_mem_coalesce()
168 nxt_off_t size, last; in nxt_sendbuf_file_coalesce() local
174 total = sb->size; in nxt_sendbuf_file_coalesce()
187 total += size; in nxt_sendbuf_file_coalesce()
204 sb->size = total; in nxt_sendbuf_file_coalesce()
308 size = nxt_min(size, bsize); in nxt_sendbuf_copy()
[all …]
H A Dnxt_array.c11 nxt_array_create(nxt_mp_t *mp, nxt_uint_t n, size_t size) in nxt_array_create() argument
15 array = nxt_mp_alloc(mp, sizeof(nxt_array_t) + n * size); in nxt_array_create()
23 array->size = size; in nxt_array_create()
67 nxt_memcpy(p, array->elts, array->size * nalloc); in nxt_array_add()
92 nxt_memzero(p, array->size); in nxt_array_zero_add()
107 nxt_memcpy(elt, last, array->size); in nxt_array_remove()
118 uint32_t i, size; in nxt_array_copy() local
120 size = src->size; in nxt_array_copy()
123 dst = nxt_array_create(mp, src->nelts, size); in nxt_array_copy()
129 nxt_assert(size == dst->size); in nxt_array_copy()
[all …]
H A Dnxt_mp.c46 uint8_t size; member
145 memset((p), 0x5A, size)
423 memset(p, 0, size); in nxt_mp_zalloc()
490 if (size > 1) { in nxt_mp_chunk_pages_index()
630 page->size = 0xFF; in nxt_mp_get_small()
638 page->u.taken += size; in nxt_mp_get_small()
754 block->size = size; in nxt_mp_alloc_large()
882 size = page->size << mp->chunk_size_shift; in nxt_mp_chunk_free()
931 page->size = 0; in nxt_mp_chunk_free()
1006 size = nxt_max(size, NXT_MAX_ALIGNMENT); in nxt_mp_get()
[all …]
H A Dnxt_socket_msg.h46 size_t size; member
52 size_t size; member
94 oob->size = 0; in nxt_socket_msg_oob_init()
129 size_t size; in nxt_socket_msg_oob_get_fds() local
134 msg.msg_controllen = oob->size; in nxt_socket_msg_oob_get_fds()
140 size = cmsg->cmsg_len - CMSG_LEN(0); in nxt_socket_msg_oob_get_fds()
143 if (nxt_slow_path(size != sizeof(int) && size != 2 * sizeof(int))) { in nxt_socket_msg_oob_get_fds()
160 size_t size; in nxt_socket_msg_oob_get() local
164 if (oob->size == 0) { in nxt_socket_msg_oob_get()
173 msg.msg_controllen = oob->size; in nxt_socket_msg_oob_get()
[all …]
H A Dnxt_process_title.c77 strings_size += size; in nxt_process_arguments()
78 end = argv[i] + size; in nxt_process_arguments()
114 strings_size += size; in nxt_process_arguments()
115 end = env[i] + size; in nxt_process_arguments()
145 end = argv[i] + size; in nxt_process_arguments()
147 p += size; in nxt_process_arguments()
173 nxt_memcpy(p, env[i], size); in nxt_process_arguments()
175 end = env[i] + size; in nxt_process_arguments()
177 p += size; in nxt_process_arguments()
214 size_t size; in nxt_process_title() local
[all …]
H A Dnxt_solaris_sendfilev.c32 nxt_off_t size; in nxt_solaris_event_conn_io_sendfilev() local
81 if ((nxt_off_t) sent < size) { in nxt_solaris_event_conn_io_sendfilev()
93 size_t size, total; in nxt_solaris_buf_coalesce() local
109 size = b->file_end - pos; in nxt_solaris_buf_coalesce()
111 if (size == 0) { in nxt_solaris_buf_coalesce()
125 if (size == 0) { in nxt_solaris_buf_coalesce()
138 if (size == 0) { in nxt_solaris_buf_coalesce()
151 sfv[i].sfv_len = size; in nxt_solaris_buf_coalesce()
154 sfv[i].sfv_len += size; in nxt_solaris_buf_coalesce()
157 total += size; in nxt_solaris_buf_coalesce()
[all …]
H A Dnxt_errno.c26 size_t size);
27 static u_char *nxt_runtime_strerror(nxt_err_t err, u_char *errstr, size_t size);
40 size_t size, length, n; in nxt_strerror_start() local
44 size = nxt_length("Unknown error"); in nxt_strerror_start()
77 size += length; in nxt_strerror_start()
105 nxt_sys_errlist = nxt_malloc(n + size); in nxt_strerror_start()
133 nxt_bootstrap_strerror(nxt_err_t err, u_char *errstr, size_t size) in nxt_bootstrap_strerror() argument
135 return nxt_cpystrn(errstr, (u_char *) strerror(err), size); in nxt_bootstrap_strerror()
140 nxt_runtime_strerror(nxt_err_t err, u_char *errstr, size_t size) in nxt_runtime_strerror() argument
149 size = nxt_min(size, msg->length); in nxt_runtime_strerror()
[all …]
H A Dnxt_recvbuf.c14 size_t size, total; in nxt_recvbuf_mem_coalesce() local
26 size = b->mem.end - b->mem.free; in nxt_recvbuf_mem_coalesce()
34 nxt_iobuf_set(&rb->iobuf[n], b->mem.free, size); in nxt_recvbuf_mem_coalesce()
37 nxt_iobuf_add(&rb->iobuf[n], size); in nxt_recvbuf_mem_coalesce()
44 total += size; in nxt_recvbuf_mem_coalesce()
52 rb->size = total; in nxt_recvbuf_mem_coalesce()
61 size_t size; in nxt_recvbuf_update() local
69 size = b->mem.end - b->mem.free; in nxt_recvbuf_update()
71 if (sent < size) { in nxt_recvbuf_update()
77 sent -= size; in nxt_recvbuf_update()
H A Dnxt_job_file.c62 size_t size; in nxt_job_file_open_and_read() local
96 if (file->size > 0) { in nxt_job_file_open_and_read()
100 size = nxt_min(file->size, (nxt_off_t) size); in nxt_job_file_open_and_read()
104 size = nxt_min(file->size, 1024 * 1024); in nxt_job_file_open_and_read()
115 n = nxt_job_file_mmap(jbf, size); in nxt_job_file_open_and_read()
128 if (jbf->offset == file->size) { in nxt_job_file_open_and_read()
222 file->size = nxt_file_size(&fi); in nxt_job_file_info()
227 file->size = nxt_file_size(&fi); in nxt_job_file_info()
247 end = p + size; in nxt_job_file_mmap()
253 jbf->buffer->file_end += size; in nxt_job_file_mmap()
[all …]
H A Dnxt_mp.h67 NXT_EXPORT void *nxt_mp_alloc(nxt_mp_t *mp, size_t size)
75 NXT_EXPORT void *nxt_mp_zalloc(nxt_mp_t *mp, size_t size)
79 NXT_EXPORT void *nxt_mp_align(nxt_mp_t *mp, size_t alignment, size_t size)
83 NXT_EXPORT void *nxt_mp_zalign(nxt_mp_t *mp, size_t alignment, size_t size)
91 NXT_EXPORT void *nxt_mp_nget(nxt_mp_t *mp, size_t size)
98 NXT_EXPORT void *nxt_mp_get(nxt_mp_t *mp, size_t size)
105 NXT_EXPORT void *nxt_mp_zget(nxt_mp_t *mp, size_t size)
116 NXT_EXPORT void *nxt_mp_lvlhsh_alloc(void *pool, size_t size);
H A Dnxt_array.h15 uint16_t size; member
22 nxt_array_init(nxt_array_t *array, nxt_mp_t *mp, size_t size) in nxt_array_init() argument
25 array->size = size; in nxt_array_init()
30 size_t size);
39 nxt_pointer_to((array)->elts, (array)->size * ((array)->nelts - 1))
54 return nxt_pointer_to(array->elts, array->size * array->nelts); in nxt_array_remove_last()
H A Dnxt_linux_sendfile.c49 size_t size; in nxt_linux_event_conn_io_sendfile() local
62 sb.size = 0; in nxt_linux_event_conn_io_sendfile()
96 size = nxt_sendbuf_file_coalesce(&sb); in nxt_linux_event_conn_io_sendfile()
99 c->socket.fd, fb->file->fd, fb->file_pos, size); in nxt_linux_event_conn_io_sendfile()
123 c->socket.fd, fb->file->fd, fb->file_pos, size, in nxt_linux_event_conn_io_sendfile()
134 if (n < (ssize_t) size) { in nxt_linux_event_conn_io_sendfile()
148 n = send(c->socket.fd, buf, size, flags); in nxt_linux_send()
153 c->socket.fd, buf, size, flags, n); in nxt_linux_send()
169 c->socket.fd, buf, size, flags, err); in nxt_linux_send()
179 if (n < (ssize_t) size) { in nxt_linux_send()
[all …]
H A Dnxt_buf.c26 b->mem.end = nxt_pointer_to(start, size); in nxt_buf_mem_init()
45 if (size != 0) { in nxt_buf_mem_alloc()
49 b->mem.end = b->mem.start + size; in nxt_buf_mem_alloc()
75 if (size != 0) { in nxt_buf_mem_ts_alloc()
80 b->mem.end = b->mem.start + size; in nxt_buf_mem_ts_alloc()
111 if (size != 0) { in nxt_buf_file_alloc()
115 b->mem.end = b->mem.start + size; in nxt_buf_file_alloc()
135 nxt_buf_mem_set_size(&b->mem, size); in nxt_buf_mmap_alloc()
306 if (nxt_slow_path(size == 0)) { in nxt_buf_make_plain()
308 size += nxt_buf_used_size(i); in nxt_buf_make_plain()
[all …]
H A Dnxt_port_queue.h20 uint8_t size; member
50 nxt_port_queue_send(nxt_port_queue_t volatile *q, const void *p, uint8_t size, in nxt_port_queue_send() argument
64 qi->size = size; in nxt_port_queue_send()
65 nxt_memcpy(qi->data, p, size); in nxt_port_queue_send()
91 res = qi->size; in nxt_port_queue_recv()
92 nxt_memcpy(p, qi->data, qi->size); in nxt_port_queue_recv()
H A Dnxt_clone.c148 if (map->size > 0) { in nxt_clone_credential_map_set()
149 len = len * map->size + 1; in nxt_clone_credential_map_set()
159 for (i = 0; i < map->size; i++) { in nxt_clone_credential_map_set()
169 if (i+1 < map->size) { in nxt_clone_credential_map_set()
265 if (map->size == 0) { in nxt_clone_vldt_credential_uidmap()
275 map->size); in nxt_clone_vldt_credential_uidmap()
293 for (i = 0; i < map->size; i++) { in nxt_clone_vldt_credential_uidmap()
333 if (map->size == 0) { in nxt_clone_vldt_credential_gidmap()
340 map->size); in nxt_clone_vldt_credential_gidmap()
358 m.size); in nxt_clone_vldt_credential_gidmap()
[all …]
/unit/src/test/
H A Dnxt_malloc_test.c15 size_t size; member
35 p[i] = nxt_malloc(size); in nxt_malloc_run_test()
53 s = size; in nxt_malloc_run_test()
76 last->size = size; in nxt_malloc_run_test()
87 size_t size; in nxt_malloc_test() local
95 for (size = 1; size < 64; size++) { in nxt_malloc_test()
96 last = nxt_malloc_run_test(thr, last, size, TIMES); in nxt_malloc_test()
102 for (size = 64; size < 16384; size += 8) { in nxt_malloc_test()
103 last = nxt_malloc_run_test(thr, last, size, TIMES / 4); in nxt_malloc_test()
109 for (size = 16384; size < 512 * 1024 + 129; size += 128) { in nxt_malloc_test()
[all …]
H A Dnxt_mem_zone_test.c17 uint32_t size; in nxt_mem_zone_test() local
43 size = 0; in nxt_mem_zone_test()
50 size = nxt_murmur_hash2(&size, sizeof(uint32_t)); in nxt_mem_zone_test()
52 total += size & max_size; in nxt_mem_zone_test()
53 blocks[n] = nxt_mem_zone_alloc(zone, size & max_size); in nxt_mem_zone_test()
/unit/src/java/nginx/unit/
H A DHeaderNamesEnumeration.java10 private long size; field in HeaderNamesEnumeration
15 size = _size; in HeaderNamesEnumeration()
21 if (pos >= size) { in hasMoreElements()
25 pos = nextElementPos(headers_ptr, size, pos); in hasMoreElements()
26 return pos < size; in hasMoreElements()
29 static private native long nextElementPos(long headers_ptr, long size, long pos); in nextElementPos() argument
34 if (pos >= size) { in nextElement()
38 return nextElement(headers_ptr, size, pos++); in nextElement()
41 static private native String nextElement(long headers_ptr, long size, long pos); in nextElement() argument
H A DHeadersEnumeration.java9 private long size; field in HeadersEnumeration
15 size = _size; in HeadersEnumeration()
23 if (pos >= size) { in hasMoreElements()
27 pos = nextElementPos(headers_ptr, size, initial_pos, pos); in hasMoreElements()
28 return pos < size; in hasMoreElements()
31 …static private native long nextElementPos(long headers_ptr, long size, long initial_pos, long pos); in nextElementPos() argument
36 return nextElement(headers_ptr, size, initial_pos, pos++); in nextElement()
39 … static private native String nextElement(long headers_ptr, long size, long initial_pos, long pos); in nextElement() argument
/unit/src/java/
H A Dnxt_jni_HeaderNamesEnumeration.c19 jclass cls, jlong headers_ptr, jlong size, jlong pos);
21 jclass cls, jlong headers_ptr, jlong size, jlong pos);
89 jlong headers_ptr, jlong size, jlong pos) in nxt_java_HeaderNamesEnumeration_nextElementPos() argument
95 if (pos >= size) { in nxt_java_HeaderNamesEnumeration_nextElementPos()
96 return size; in nxt_java_HeaderNamesEnumeration_nextElementPos()
100 while (pos < size in nxt_java_HeaderNamesEnumeration_nextElementPos()
114 jlong headers_ptr, jlong size, jlong pos) in nxt_java_HeaderNamesEnumeration_nextElement() argument
123 while (pos < size in nxt_java_HeaderNamesEnumeration_nextElement()
131 if (pos >= size) { in nxt_java_HeaderNamesEnumeration_nextElement()
H A Dnxt_jni_HeadersEnumeration.c23 jclass cls, jlong headers_ptr, jlong size, jlong ipos, jlong pos);
26 jclass cls, jlong headers_ptr, jlong size, jlong ipos, jlong pos);
89 jlong headers_ptr, jlong size, jlong ipos, jlong pos) in nxt_java_HeadersEnumeration_nextElementPos() argument
97 if (pos >= size) { in nxt_java_HeadersEnumeration_nextElementPos()
98 return size; in nxt_java_HeadersEnumeration_nextElementPos()
106 return size; in nxt_java_HeadersEnumeration_nextElementPos()
113 return size; in nxt_java_HeadersEnumeration_nextElementPos()
122 jlong headers_ptr, jlong size, jlong ipos, jlong pos) in nxt_java_HeadersEnumeration_nextElement() argument
130 if (pos >= size) { in nxt_java_HeadersEnumeration_nextElement()

1234567