comparison src/core/ngx_palloc.c @ 258:6ae1357b7b7c NGINX_0_4_14

nginx 0.4.14 *) Feature: the "proxy_pass_error_message" directive in IMAP/POP3 proxy. *) Feature: now configure detects system PCRE library on FreeBSD, Linux, and NetBSD. *) Bugfix: ngx_http_perl_module did not work with perl built with the threads support; bug appeared in 0.3.38. *) Bugfix: ngx_http_perl_module did not work if perl was called recursively. *) Bugfix: nginx ignored a host name in an request line. *) Bugfix: a worker process may got caught in an endless loop, if a FastCGI server sent too many data to the stderr. *) Bugfix: the $upstream_response_time variable may be negative if the system time was changed backward. *) Bugfix: the "Auth-Login-Attempt" parameter was not sent to IMAP/POP3 proxy authentication server when POP3 was used. *) Bugfix: a segmentation fault might occur if connect to IMAP/POP3 proxy authentication server failed.
author Igor Sysoev <http://sysoev.ru>
date Mon, 27 Nov 2006 00:00:00 +0300
parents 87699398f955
children 6eb1e38f0f1f
comparison
equal deleted inserted replaced
257:0e566ee1bcd5 258:6ae1357b7b7c
191 191
192 return p; 192 return p;
193 } 193 }
194 194
195 195
196 void *
197 ngx_shalloc(size_t size)
198 {
199 u_char *p;
200
201 if (size < sizeof(int) || (size & 1)) {
202 p = ngx_cycle->shm_last;
203
204 } else {
205 p = ngx_align_ptr(ngx_cycle->shm_last, NGX_ALIGNMENT);
206 }
207
208 if ((size_t) (ngx_cycle->shm_end - p) >= size) {
209 ngx_cycle->shm_last = p + size;
210 return p;
211 }
212
213 ngx_log_error(NGX_LOG_EMERG, ngx_cycle->log, 0,
214 "allocation of %uz bytes in shared memory failed, "
215 "only %uz are available",
216 size, ngx_cycle->shm_end - ngx_cycle->shm_last);
217
218 return NULL;
219 }
220
221
222 void *
223 ngx_shcalloc(size_t size)
224 {
225 void *p;
226
227 p = ngx_shalloc(size);
228 if (p) {
229 ngx_memzero(p, size);
230 }
231
232 return p;
233 }
234
235
236 ngx_pool_cleanup_t * 196 ngx_pool_cleanup_t *
237 ngx_pool_cleanup_add(ngx_pool_t *p, size_t size) 197 ngx_pool_cleanup_add(ngx_pool_t *p, size_t size)
238 { 198 {
239 ngx_pool_cleanup_t *c; 199 ngx_pool_cleanup_t *c;
240 200