comparison src/os/unix/ngx_alloc.h @ 346:55e496a8ece3

nginx-0.0.3-2004-06-06-23:49:18 import
author Igor Sysoev <igor@sysoev.ru>
date Sun, 06 Jun 2004 19:49:18 +0000
parents
children da8c5707af39
comparison
equal deleted inserted replaced
345:fade4edd61f8 346:55e496a8ece3
1 #ifndef _NGX_ALLOC_H_INCLUDED_
2 #define _NGX_ALLOC_H_INCLUDED_
3
4
5 #include <ngx_config.h>
6 #include <ngx_core.h>
7
8
9 void *ngx_alloc(size_t size, ngx_log_t *log);
10 void *ngx_calloc(size_t size, ngx_log_t *log);
11
12 #define ngx_free free
13
14
15 /*
16 * Linux has memalign() or posix_memalign()
17 * Solaris has memalign()
18 * FreeBSD has not memalign() or posix_memalign() but its malloc() alignes
19 * allocations bigger than page size at page boundary.
20 */
21
22 #if (HAVE_POSIX_MEMALIGN || HAVE_MEMALIGN)
23
24 void *ngx_memalign(size_t alignment, size_t size, ngx_log_t *log);
25
26 #else
27
28 #define ngx_memalign(alignment, size, log) ngx_alloc(size, log)
29
30 #endif
31
32
33 extern int ngx_pagesize;
34
35
36 #endif /* _NGX_ALLOC_H_INCLUDED_ */