comparison src/core/ngx_alloc.h @ 100:7ebc8b7fb816

nginx-0.0.1-2003-06-03-19:42:58 import
author Igor Sysoev <igor@sysoev.ru>
date Tue, 03 Jun 2003 15:42:58 +0000
parents 637625a2acdb
children afc333135a6b
comparison
equal deleted inserted replaced
99:a059e1aa65d4 100:7ebc8b7fb816
1 #ifndef _NGX_ALLOC_H_INCLUDED_ 1 #ifndef _NGX_ALLOC_H_INCLUDED_
2 #define _NGX_ALLOC_H_INCLUDED_ 2 #define _NGX_ALLOC_H_INCLUDED_
3 3
4 4
5 #include <ngx_config.h> 5 #include <ngx_config.h>
6 #include <ngx_core.h>
6 7
7 #include <ngx_log.h>
8 8
9 /* NGX_MAX_ALLOC_FROM_POOL should be (PAGE_SIZE - 1), i.e. 4095 on x86. 9 /* NGX_MAX_ALLOC_FROM_POOL should be (PAGE_SIZE - 1), i.e. 4095 on x86.
10 On FreeBSD 5.x it allows to use zero copy send. 10 On FreeBSD 5.x it allows to use zero copy send.
11 On Windows NT it decreases number of locked pages in kernel. 11 On Windows NT it decreases number of locked pages in kernel.
12 */ 12 */
16 16
17 #define ngx_test_null(p, alloc, rc) if ((p = alloc) == NULL) { return rc; } 17 #define ngx_test_null(p, alloc, rc) if ((p = alloc) == NULL) { return rc; }
18 18
19 19
20 typedef struct ngx_pool_large_s ngx_pool_large_t; 20 typedef struct ngx_pool_large_s ngx_pool_large_t;
21
21 struct ngx_pool_large_s { 22 struct ngx_pool_large_s {
22 ngx_pool_large_t *next; 23 ngx_pool_large_t *next;
23 void *alloc; 24 void *alloc;
24 }; 25 };
25 26
26 typedef struct ngx_pool_s ngx_pool_t; 27
28 typedef struct ngx_pool_s ngx_pool_t;
29
27 struct ngx_pool_s { 30 struct ngx_pool_s {
28 char *last; 31 char *last;
29 char *end; 32 char *end;
30 ngx_pool_t *next; 33 ngx_pool_t *next;
31 ngx_pool_large_t *large; 34 ngx_pool_large_t *large;