Mercurial > hg > nginx-quic
annotate src/core/ngx_palloc.h @ 2462:90d5ddfedbb1
use GetFileAttributesEx() instead of GetFileAttributes()
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Wed, 21 Jan 2009 15:56:29 +0000 |
parents | cc13ff6d5c07 |
children | 3a8a53c0c42f |
rev | line source |
---|---|
441
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
436
diff
changeset
|
1 |
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
436
diff
changeset
|
2 /* |
444
42d11f017717
nginx-0.1.0-2004-09-29-20:00:49 import; remove years from copyright
Igor Sysoev <igor@sysoev.ru>
parents:
441
diff
changeset
|
3 * Copyright (C) Igor Sysoev |
441
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
436
diff
changeset
|
4 */ |
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
436
diff
changeset
|
5 |
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
436
diff
changeset
|
6 |
346
55e496a8ece3
nginx-0.0.3-2004-06-06-23:49:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
7 #ifndef _NGX_PALLOC_H_INCLUDED_ |
55e496a8ece3
nginx-0.0.3-2004-06-06-23:49:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
8 #define _NGX_PALLOC_H_INCLUDED_ |
0
4eff17414a43
nginx-0.0.1-2002-08-06-20:39:45 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
9 |
4eff17414a43
nginx-0.0.1-2002-08-06-20:39:45 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
10 |
4eff17414a43
nginx-0.0.1-2002-08-06-20:39:45 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
11 #include <ngx_config.h> |
100
7ebc8b7fb816
nginx-0.0.1-2003-06-03-19:42:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
91
diff
changeset
|
12 #include <ngx_core.h> |
0
4eff17414a43
nginx-0.0.1-2002-08-06-20:39:45 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
13 |
4eff17414a43
nginx-0.0.1-2002-08-06-20:39:45 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
14 |
156
afc333135a6b
nginx-0.0.1-2003-10-23-10:13:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
100
diff
changeset
|
15 /* |
589 | 16 * NGX_MAX_ALLOC_FROM_POOL should be (ngx_pagesize - 1), i.e. 4095 on x86. |
195
8dee38ea9117
nginx-0.0.1-2003-11-25-23:44:56 import
Igor Sysoev <igor@sysoev.ru>
parents:
163
diff
changeset
|
17 * On Windows NT it decreases a number of locked pages in a kernel. |
78
9f81437e0ad3
nginx-0.0.1-2003-04-21-18:55:47 import
Igor Sysoev <igor@sysoev.ru>
parents:
44
diff
changeset
|
18 */ |
346
55e496a8ece3
nginx-0.0.3-2004-06-06-23:49:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
19 #define NGX_MAX_ALLOC_FROM_POOL (ngx_pagesize - 1) |
0
4eff17414a43
nginx-0.0.1-2002-08-06-20:39:45 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
20 |
1200 | 21 #define NGX_DEFAULT_POOL_SIZE (16 * 1024) |
22 #define NGX_MIN_POOL_SIZE \ | |
23 (sizeof(ngx_pool_t) + 2 * sizeof(ngx_pool_large_t)) | |
0
4eff17414a43
nginx-0.0.1-2002-08-06-20:39:45 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
24 |
4eff17414a43
nginx-0.0.1-2002-08-06-20:39:45 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
25 |
509 | 26 typedef void (*ngx_pool_cleanup_pt)(void *data); |
27 | |
28 typedef struct ngx_pool_cleanup_s ngx_pool_cleanup_t; | |
29 | |
30 struct ngx_pool_cleanup_s { | |
31 ngx_pool_cleanup_pt handler; | |
32 void *data; | |
33 ngx_pool_cleanup_t *next; | |
34 }; | |
35 | |
36 | |
0
4eff17414a43
nginx-0.0.1-2002-08-06-20:39:45 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
37 typedef struct ngx_pool_large_s ngx_pool_large_t; |
100
7ebc8b7fb816
nginx-0.0.1-2003-06-03-19:42:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
91
diff
changeset
|
38 |
0
4eff17414a43
nginx-0.0.1-2002-08-06-20:39:45 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
39 struct ngx_pool_large_s { |
509 | 40 ngx_pool_large_t *next; |
41 void *alloc; | |
0
4eff17414a43
nginx-0.0.1-2002-08-06-20:39:45 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
42 }; |
4eff17414a43
nginx-0.0.1-2002-08-06-20:39:45 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
43 |
100
7ebc8b7fb816
nginx-0.0.1-2003-06-03-19:42:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
91
diff
changeset
|
44 |
2049 | 45 typedef struct { |
509 | 46 u_char *last; |
47 u_char *end; | |
2049 | 48 ngx_pool_t *next; |
49 } ngx_pool_data_t; | |
50 | |
51 | |
52 struct ngx_pool_s { | |
53 ngx_pool_data_t d; | |
54 size_t max; | |
581 | 55 ngx_pool_t *current; |
509 | 56 ngx_chain_t *chain; |
57 ngx_pool_large_t *large; | |
58 ngx_pool_cleanup_t *cleanup; | |
59 ngx_log_t *log; | |
0
4eff17414a43
nginx-0.0.1-2002-08-06-20:39:45 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
60 }; |
4eff17414a43
nginx-0.0.1-2002-08-06-20:39:45 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
61 |
4eff17414a43
nginx-0.0.1-2002-08-06-20:39:45 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
62 |
509 | 63 typedef struct { |
64 ngx_fd_t fd; | |
65 u_char *name; | |
66 ngx_log_t *log; | |
67 } ngx_pool_cleanup_file_t; | |
68 | |
69 | |
0
4eff17414a43
nginx-0.0.1-2002-08-06-20:39:45 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
70 void *ngx_alloc(size_t size, ngx_log_t *log); |
4eff17414a43
nginx-0.0.1-2002-08-06-20:39:45 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
71 void *ngx_calloc(size_t size, ngx_log_t *log); |
4eff17414a43
nginx-0.0.1-2002-08-06-20:39:45 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
72 |
4eff17414a43
nginx-0.0.1-2002-08-06-20:39:45 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
73 ngx_pool_t *ngx_create_pool(size_t size, ngx_log_t *log); |
4eff17414a43
nginx-0.0.1-2002-08-06-20:39:45 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
74 void ngx_destroy_pool(ngx_pool_t *pool); |
2337 | 75 void ngx_reset_pool(ngx_pool_t *pool); |
0
4eff17414a43
nginx-0.0.1-2002-08-06-20:39:45 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
76 |
4eff17414a43
nginx-0.0.1-2002-08-06-20:39:45 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
77 void *ngx_palloc(ngx_pool_t *pool, size_t size); |
2049 | 78 void *ngx_pnalloc(ngx_pool_t *pool, size_t size); |
0
4eff17414a43
nginx-0.0.1-2002-08-06-20:39:45 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
79 void *ngx_pcalloc(ngx_pool_t *pool, size_t size); |
2129 | 80 void *ngx_pmemalign(ngx_pool_t *pool, size_t size, size_t alignment); |
436
9549fc9508e5
nginx-0.0.11-2004-09-23-10:32:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
354
diff
changeset
|
81 ngx_int_t ngx_pfree(ngx_pool_t *pool, void *p); |
156
afc333135a6b
nginx-0.0.1-2003-10-23-10:13:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
100
diff
changeset
|
82 |
0
4eff17414a43
nginx-0.0.1-2002-08-06-20:39:45 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
83 |
563 | 84 ngx_pool_cleanup_t *ngx_pool_cleanup_add(ngx_pool_t *p, size_t size); |
509 | 85 void ngx_pool_cleanup_file(void *data); |
1075
4d203f76b757
undo "client_body_in_file_only any"
Igor Sysoev <igor@sysoev.ru>
parents:
860
diff
changeset
|
86 void ngx_pool_delete_file(void *data); |
509 | 87 |
88 | |
346
55e496a8ece3
nginx-0.0.3-2004-06-06-23:49:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
195
diff
changeset
|
89 #endif /* _NGX_PALLOC_H_INCLUDED_ */ |