comparison src/os/win32/ngx_win32_init.c @ 860:201d017ea470

slab allocator in shared memory
author Igor Sysoev <igor@sysoev.ru>
date Mon, 20 Nov 2006 08:51:45 +0000
parents d4e858a5751a
children 74b2a52bc3c9
comparison
equal deleted inserted replaced
859:d1e8c59a50ee 860:201d017ea470
51 ngx_int_t ngx_os_init(ngx_log_t *log) 51 ngx_int_t ngx_os_init(ngx_log_t *log)
52 { 52 {
53 DWORD bytes; 53 DWORD bytes;
54 SOCKET s; 54 SOCKET s;
55 WSADATA wsd; 55 WSADATA wsd;
56 ngx_uint_t n;
56 SYSTEM_INFO si; 57 SYSTEM_INFO si;
57 58
58 /* get Windows version */ 59 /* get Windows version */
59 60
60 ngx_memzero(&osvi, sizeof(OSVERSIONINFOEX)); 61 ngx_memzero(&osvi, sizeof(OSVERSIONINFOEX));
99 GetSystemInfo(&si); 100 GetSystemInfo(&si);
100 ngx_pagesize = si.dwPageSize; 101 ngx_pagesize = si.dwPageSize;
101 ngx_ncpu = si.dwNumberOfProcessors; 102 ngx_ncpu = si.dwNumberOfProcessors;
102 ngx_cacheline_size = NGX_CPU_CACHE_LINE; 103 ngx_cacheline_size = NGX_CPU_CACHE_LINE;
103 104
105 for (n = ngx_pagesize; n >>= 1; ngx_pagesize_shift++) { /* void */ }
106
104 107
105 /* init Winsock */ 108 /* init Winsock */
106 109
107 if (WSAStartup(MAKEWORD(2,2), &wsd) != 0) { 110 if (WSAStartup(MAKEWORD(2,2), &wsd) != 0) {
108 ngx_log_error(NGX_LOG_EMERG, log, ngx_socket_errno, 111 ngx_log_error(NGX_LOG_EMERG, log, ngx_socket_errno,