comparison src/http/modules/ngx_http_gzip_filter.c @ 433:9a97dcdd2421

nginx-0.0.11-2004-09-21-19:47:05 import
author Igor Sysoev <igor@sysoev.ru>
date Tue, 21 Sep 2004 15:47:05 +0000
parents 358bbd2561b5
children da8c5707af39
comparison
equal deleted inserted replaced
432:11362a3e3911 433:9a97dcdd2421
438 * dicreases a number of malloc() and free() calls and also probably 438 * dicreases a number of malloc() and free() calls and also probably
439 * dicreases a number of syscalls (sbrk() or so). 439 * dicreases a number of syscalls (sbrk() or so).
440 * Besides we free this memory as soon as the gzipping will complete 440 * Besides we free this memory as soon as the gzipping will complete
441 * and do not wait while a whole response will be sent to a client. 441 * and do not wait while a whole response will be sent to a client.
442 * 442 *
443 * 8K is for zlib deflate_state. It takes 5816 bytes on x86 443 * 8K is for zlib deflate_state, it takes
444 * and 5920 bytes on amd64. 444 * * 5816 bytes on x86 and sparc64 (32-bit mode)
445 * * 5920 bytes on amd64 and sparc64
445 */ 446 */
446 447
447 ctx->allocated = 8192 + (1 << (wbits + 2)) + (1 << (memlevel + 9)); 448 ctx->allocated = 8192 + (1 << (wbits + 2)) + (1 << (memlevel + 9));
448 449
449 if (!(ctx->preallocated = ngx_palloc(r->pool, ctx->allocated))) { 450 if (!(ctx->preallocated = ngx_palloc(r->pool, ctx->allocated))) {
801 802
802 alloc = items * size; 803 alloc = items * size;
803 if (alloc % 512 != 0) { 804 if (alloc % 512 != 0) {
804 805
805 /* 806 /*
806 * The zlib deflate_state allocation, it takes 5816 bytes on x86 807 * the zlib deflate_state allocation, it takes about 6K, we allocate 8K
807 * and 5920 bytes on amd64.
808 * We allocate 8K.
809 */ 808 */
810 809
811 alloc = (alloc + ngx_pagesize - 1) & ~(ngx_pagesize - 1); 810 alloc = (alloc + ngx_pagesize - 1) & ~(ngx_pagesize - 1);
812 } 811 }
813 812