Mercurial > hg > nginx-quic
comparison src/core/ngx_crc32.c @ 930:45df22906c12
allocate aligned ngx_crc32_table_short globally
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Fri, 15 Dec 2006 21:31:03 +0000 |
parents | 8d39da951bbd |
children | 8902a211b00e |
comparison
equal
deleted
inserted
replaced
929:1adfc55bb6dc | 930:45df22906c12 |
---|---|
100 | 100 |
101 uint32_t *ngx_crc32_table_short = ngx_crc32_table16; | 101 uint32_t *ngx_crc32_table_short = ngx_crc32_table16; |
102 | 102 |
103 | 103 |
104 ngx_int_t | 104 ngx_int_t |
105 ngx_crc32_init(ngx_pool_t *pool) | 105 ngx_crc32_init(void) |
106 { | 106 { |
107 void *p; | 107 void *p; |
108 | 108 |
109 if (((uintptr_t) ngx_crc32_table_short | 109 if (((uintptr_t) ngx_crc32_table_short |
110 & ~((uintptr_t) ngx_cacheline_size - 1)) | 110 & ~((uintptr_t) ngx_cacheline_size - 1)) |
111 == (uintptr_t) ngx_crc32_table_short) | 111 == (uintptr_t) ngx_crc32_table_short) |
112 { | 112 { |
113 return NGX_OK; | 113 return NGX_OK; |
114 } | 114 } |
115 | 115 |
116 p = ngx_palloc(pool, 16 * sizeof(uint32_t) + ngx_cacheline_size); | 116 p = ngx_alloc(16 * sizeof(uint32_t) + ngx_cacheline_size, ngx_cycle->log); |
117 if (p == NULL) { | 117 if (p == NULL) { |
118 return NGX_ERROR; | 118 return NGX_ERROR; |
119 } | 119 } |
120 | 120 |
121 p = ngx_align_ptr(p, ngx_cacheline_size); | 121 p = ngx_align_ptr(p, ngx_cacheline_size); |