3 * Copyright (C) Igor Sysoev
4 * Copyright (C) Nginx, Inc.
8 #ifndef _NGX_ALLOC_H_INCLUDED_
9 #define _NGX_ALLOC_H_INCLUDED_
12 #include <ngx_config.h>
16 void *ngx_alloc(size_t size
, ngx_log_t
*log
);
17 void *ngx_calloc(size_t size
, ngx_log_t
*log
);
23 * Linux has memalign() or posix_memalign()
24 * Solaris has memalign()
25 * FreeBSD 7.0 has posix_memalign(), besides, early version's malloc()
26 * aligns allocations bigger than page size at the page boundary
29 #if (NGX_HAVE_POSIX_MEMALIGN || NGX_HAVE_MEMALIGN)
31 void *ngx_memalign(size_t alignment
, size_t size
, ngx_log_t
*log
);
35 #define ngx_memalign(alignment, size, log) ngx_alloc(size, log)
40 extern ngx_uint_t ngx_pagesize
;
41 extern ngx_uint_t ngx_pagesize_shift
;
42 extern ngx_uint_t ngx_cacheline_size
;
45 #endif /* _NGX_ALLOC_H_INCLUDED_ */