mirror of
https://github.com/nginx/nginx.git
synced 2024-12-05 06:19:01 +08:00
allocate aligned ngx_crc32_table_short globally
This commit is contained in:
parent
e2bec9066a
commit
c690675ed1
@ -252,6 +252,12 @@ main(int argc, char *const *argv)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ngx_crc32_init() requires ngx_cacheline_size set in ngx_os_init() */
|
||||||
|
|
||||||
|
if (ngx_crc32_init() != NGX_OK) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
if (ngx_add_inherited_sockets(&init_cycle) != NGX_OK) {
|
if (ngx_add_inherited_sockets(&init_cycle) != NGX_OK) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -283,10 +289,6 @@ main(int argc, char *const *argv)
|
|||||||
|
|
||||||
ngx_os_status(cycle->log);
|
ngx_os_status(cycle->log);
|
||||||
|
|
||||||
if (ngx_crc32_init(cycle->pool) != NGX_OK) {
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
ngx_cycle = cycle;
|
ngx_cycle = cycle;
|
||||||
|
|
||||||
ccf = (ngx_core_conf_t *) ngx_get_conf(cycle->conf_ctx, ngx_core_module);
|
ccf = (ngx_core_conf_t *) ngx_get_conf(cycle->conf_ctx, ngx_core_module);
|
||||||
|
@ -102,7 +102,7 @@ uint32_t *ngx_crc32_table_short = ngx_crc32_table16;
|
|||||||
|
|
||||||
|
|
||||||
ngx_int_t
|
ngx_int_t
|
||||||
ngx_crc32_init(ngx_pool_t *pool)
|
ngx_crc32_init(void)
|
||||||
{
|
{
|
||||||
void *p;
|
void *p;
|
||||||
|
|
||||||
@ -113,7 +113,7 @@ ngx_crc32_init(ngx_pool_t *pool)
|
|||||||
return NGX_OK;
|
return NGX_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
p = ngx_palloc(pool, 16 * sizeof(uint32_t) + ngx_cacheline_size);
|
p = ngx_alloc(16 * sizeof(uint32_t) + ngx_cacheline_size, ngx_cycle->log);
|
||||||
if (p == NULL) {
|
if (p == NULL) {
|
||||||
return NGX_ERROR;
|
return NGX_ERROR;
|
||||||
}
|
}
|
||||||
|
@ -49,7 +49,7 @@ ngx_crc32_long(u_char *p, size_t len)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ngx_int_t ngx_crc32_init(ngx_pool_t *pool);
|
ngx_int_t ngx_crc32_init(void);
|
||||||
|
|
||||||
|
|
||||||
#endif /* _NGX_CRC32_H_INCLUDED_ */
|
#endif /* _NGX_CRC32_H_INCLUDED_ */
|
||||||
|
Loading…
Reference in New Issue
Block a user