Mercurial > hg > nginx
annotate src/os/win32/ngx_shmem.c @ 6470:62d950bc0f15
Updated OpenSSL used for win32 builds.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Tue, 29 Mar 2016 09:54:11 +0300 |
parents | af7eba90645d |
children |
rev | line source |
---|---|
605 | 1 |
2 /* | |
3 * Copyright (C) Igor Sysoev | |
4412 | 4 * Copyright (C) Nginx, Inc. |
605 | 5 */ |
6 | |
7 | |
8 #include <ngx_config.h> | |
9 #include <ngx_core.h> | |
10 | |
11 | |
6133
af7eba90645d
Win32: shared memory base addresses and remapping.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4570
diff
changeset
|
12 /* |
af7eba90645d
Win32: shared memory base addresses and remapping.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4570
diff
changeset
|
13 * Base addresses selected by system for shared memory mappings are likely |
af7eba90645d
Win32: shared memory base addresses and remapping.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4570
diff
changeset
|
14 * to be different on Windows Vista and later versions due to address space |
af7eba90645d
Win32: shared memory base addresses and remapping.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4570
diff
changeset
|
15 * layout randomization. This is however incompatible with storing absolute |
af7eba90645d
Win32: shared memory base addresses and remapping.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4570
diff
changeset
|
16 * addresses within the shared memory. |
af7eba90645d
Win32: shared memory base addresses and remapping.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4570
diff
changeset
|
17 * |
af7eba90645d
Win32: shared memory base addresses and remapping.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4570
diff
changeset
|
18 * To make it possible to store absolute addresses we create mappings |
af7eba90645d
Win32: shared memory base addresses and remapping.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4570
diff
changeset
|
19 * at the same address in all processes by starting mappings at predefined |
af7eba90645d
Win32: shared memory base addresses and remapping.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4570
diff
changeset
|
20 * addresses. The addresses were selected somewhat randomly in order to |
af7eba90645d
Win32: shared memory base addresses and remapping.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4570
diff
changeset
|
21 * minimize the probability that some other library doing something similar |
af7eba90645d
Win32: shared memory base addresses and remapping.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4570
diff
changeset
|
22 * conflicts with us. The addresses are from the following typically free |
af7eba90645d
Win32: shared memory base addresses and remapping.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4570
diff
changeset
|
23 * blocks: |
af7eba90645d
Win32: shared memory base addresses and remapping.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4570
diff
changeset
|
24 * |
af7eba90645d
Win32: shared memory base addresses and remapping.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4570
diff
changeset
|
25 * - 0x10000000 .. 0x70000000 (about 1.5 GB in total) on 32-bit platforms |
af7eba90645d
Win32: shared memory base addresses and remapping.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4570
diff
changeset
|
26 * - 0x000000007fff0000 .. 0x000007f68e8b0000 (about 8 TB) on 64-bit platforms |
af7eba90645d
Win32: shared memory base addresses and remapping.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4570
diff
changeset
|
27 * |
af7eba90645d
Win32: shared memory base addresses and remapping.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4570
diff
changeset
|
28 * Additionally, we allow to change the mapping address once it was detected |
af7eba90645d
Win32: shared memory base addresses and remapping.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4570
diff
changeset
|
29 * to be different from one originally used. This is needed to support |
af7eba90645d
Win32: shared memory base addresses and remapping.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4570
diff
changeset
|
30 * reconfiguration. |
af7eba90645d
Win32: shared memory base addresses and remapping.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4570
diff
changeset
|
31 */ |
af7eba90645d
Win32: shared memory base addresses and remapping.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4570
diff
changeset
|
32 |
af7eba90645d
Win32: shared memory base addresses and remapping.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4570
diff
changeset
|
33 |
af7eba90645d
Win32: shared memory base addresses and remapping.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4570
diff
changeset
|
34 #ifdef _WIN64 |
af7eba90645d
Win32: shared memory base addresses and remapping.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4570
diff
changeset
|
35 #define NGX_SHMEM_BASE 0x0000047047e00000 |
af7eba90645d
Win32: shared memory base addresses and remapping.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4570
diff
changeset
|
36 #else |
af7eba90645d
Win32: shared memory base addresses and remapping.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4570
diff
changeset
|
37 #define NGX_SHMEM_BASE 0x2efe0000 |
af7eba90645d
Win32: shared memory base addresses and remapping.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4570
diff
changeset
|
38 #endif |
af7eba90645d
Win32: shared memory base addresses and remapping.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4570
diff
changeset
|
39 |
af7eba90645d
Win32: shared memory base addresses and remapping.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4570
diff
changeset
|
40 |
af7eba90645d
Win32: shared memory base addresses and remapping.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4570
diff
changeset
|
41 ngx_uint_t ngx_allocation_granularity; |
af7eba90645d
Win32: shared memory base addresses and remapping.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4570
diff
changeset
|
42 |
af7eba90645d
Win32: shared memory base addresses and remapping.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4570
diff
changeset
|
43 |
605 | 44 ngx_int_t |
45 ngx_shm_alloc(ngx_shm_t *shm) | |
46 { | |
6133
af7eba90645d
Win32: shared memory base addresses and remapping.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4570
diff
changeset
|
47 u_char *name; |
af7eba90645d
Win32: shared memory base addresses and remapping.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4570
diff
changeset
|
48 uint64_t size; |
af7eba90645d
Win32: shared memory base addresses and remapping.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4570
diff
changeset
|
49 static u_char *base = (u_char *) NGX_SHMEM_BASE; |
2720
b3b8c66bd520
support attaching to an existent Win32 shared memory
Igor Sysoev <igor@sysoev.ru>
parents:
2716
diff
changeset
|
50 |
4570
b3d4e9c66e24
Win32: fixed memory allocation for shmem name (ticket #134).
Maxim Dounin <mdounin@mdounin.ru>
parents:
4412
diff
changeset
|
51 name = ngx_alloc(shm->name.len + 2 + NGX_INT32_LEN, shm->log); |
2720
b3b8c66bd520
support attaching to an existent Win32 shared memory
Igor Sysoev <igor@sysoev.ru>
parents:
2716
diff
changeset
|
52 if (name == NULL) { |
b3b8c66bd520
support attaching to an existent Win32 shared memory
Igor Sysoev <igor@sysoev.ru>
parents:
2716
diff
changeset
|
53 return NGX_ERROR; |
b3b8c66bd520
support attaching to an existent Win32 shared memory
Igor Sysoev <igor@sysoev.ru>
parents:
2716
diff
changeset
|
54 } |
b3b8c66bd520
support attaching to an existent Win32 shared memory
Igor Sysoev <igor@sysoev.ru>
parents:
2716
diff
changeset
|
55 |
2904
474a9daf8c80
*) fix memory leak in successful case
Igor Sysoev <igor@sysoev.ru>
parents:
2903
diff
changeset
|
56 (void) ngx_sprintf(name, "%V_%s%Z", &shm->name, ngx_unique); |
2720
b3b8c66bd520
support attaching to an existent Win32 shared memory
Igor Sysoev <igor@sysoev.ru>
parents:
2716
diff
changeset
|
57 |
b3b8c66bd520
support attaching to an existent Win32 shared memory
Igor Sysoev <igor@sysoev.ru>
parents:
2716
diff
changeset
|
58 ngx_set_errno(0); |
b3b8c66bd520
support attaching to an existent Win32 shared memory
Igor Sysoev <igor@sysoev.ru>
parents:
2716
diff
changeset
|
59 |
2903
beb0707ed8ab
allow shared memory segments more than 4G
Igor Sysoev <igor@sysoev.ru>
parents:
2737
diff
changeset
|
60 size = shm->size; |
beb0707ed8ab
allow shared memory segments more than 4G
Igor Sysoev <igor@sysoev.ru>
parents:
2737
diff
changeset
|
61 |
605 | 62 shm->handle = CreateFileMapping(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, |
2903
beb0707ed8ab
allow shared memory segments more than 4G
Igor Sysoev <igor@sysoev.ru>
parents:
2737
diff
changeset
|
63 (u_long) (size >> 32), |
beb0707ed8ab
allow shared memory segments more than 4G
Igor Sysoev <igor@sysoev.ru>
parents:
2737
diff
changeset
|
64 (u_long) (size & 0xffffffff), |
beb0707ed8ab
allow shared memory segments more than 4G
Igor Sysoev <igor@sysoev.ru>
parents:
2737
diff
changeset
|
65 (char *) name); |
605 | 66 |
67 if (shm->handle == NULL) { | |
68 ngx_log_error(NGX_LOG_ALERT, shm->log, ngx_errno, | |
2716
d5896f6608e8
move zone name from ngx_shm_zone_t to ngx_shm_t to use Win32 shared memory
Igor Sysoev <igor@sysoev.ru>
parents:
605
diff
changeset
|
69 "CreateFileMapping(%uz, %s) failed", |
2904
474a9daf8c80
*) fix memory leak in successful case
Igor Sysoev <igor@sysoev.ru>
parents:
2903
diff
changeset
|
70 shm->size, name); |
474a9daf8c80
*) fix memory leak in successful case
Igor Sysoev <igor@sysoev.ru>
parents:
2903
diff
changeset
|
71 ngx_free(name); |
474a9daf8c80
*) fix memory leak in successful case
Igor Sysoev <igor@sysoev.ru>
parents:
2903
diff
changeset
|
72 |
474a9daf8c80
*) fix memory leak in successful case
Igor Sysoev <igor@sysoev.ru>
parents:
2903
diff
changeset
|
73 return NGX_ERROR; |
2720
b3b8c66bd520
support attaching to an existent Win32 shared memory
Igor Sysoev <igor@sysoev.ru>
parents:
2716
diff
changeset
|
74 } |
b3b8c66bd520
support attaching to an existent Win32 shared memory
Igor Sysoev <igor@sysoev.ru>
parents:
2716
diff
changeset
|
75 |
2904
474a9daf8c80
*) fix memory leak in successful case
Igor Sysoev <igor@sysoev.ru>
parents:
2903
diff
changeset
|
76 ngx_free(name); |
474a9daf8c80
*) fix memory leak in successful case
Igor Sysoev <igor@sysoev.ru>
parents:
2903
diff
changeset
|
77 |
2720
b3b8c66bd520
support attaching to an existent Win32 shared memory
Igor Sysoev <igor@sysoev.ru>
parents:
2716
diff
changeset
|
78 if (ngx_errno == ERROR_ALREADY_EXISTS) { |
b3b8c66bd520
support attaching to an existent Win32 shared memory
Igor Sysoev <igor@sysoev.ru>
parents:
2716
diff
changeset
|
79 shm->exists = 1; |
605 | 80 } |
81 | |
6133
af7eba90645d
Win32: shared memory base addresses and remapping.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4570
diff
changeset
|
82 shm->addr = MapViewOfFileEx(shm->handle, FILE_MAP_WRITE, 0, 0, 0, base); |
af7eba90645d
Win32: shared memory base addresses and remapping.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4570
diff
changeset
|
83 |
af7eba90645d
Win32: shared memory base addresses and remapping.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4570
diff
changeset
|
84 if (shm->addr != NULL) { |
af7eba90645d
Win32: shared memory base addresses and remapping.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4570
diff
changeset
|
85 base += ngx_align(size, ngx_allocation_granularity); |
af7eba90645d
Win32: shared memory base addresses and remapping.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4570
diff
changeset
|
86 return NGX_OK; |
af7eba90645d
Win32: shared memory base addresses and remapping.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4570
diff
changeset
|
87 } |
af7eba90645d
Win32: shared memory base addresses and remapping.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4570
diff
changeset
|
88 |
af7eba90645d
Win32: shared memory base addresses and remapping.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4570
diff
changeset
|
89 ngx_log_debug3(NGX_LOG_DEBUG_CORE, shm->log, ngx_errno, |
af7eba90645d
Win32: shared memory base addresses and remapping.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4570
diff
changeset
|
90 "MapViewOfFileEx(%uz, %p) of file mapping \"%V\" failed, " |
af7eba90645d
Win32: shared memory base addresses and remapping.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4570
diff
changeset
|
91 "retry without a base address", |
af7eba90645d
Win32: shared memory base addresses and remapping.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4570
diff
changeset
|
92 shm->size, base, &shm->name); |
af7eba90645d
Win32: shared memory base addresses and remapping.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4570
diff
changeset
|
93 |
af7eba90645d
Win32: shared memory base addresses and remapping.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4570
diff
changeset
|
94 /* |
af7eba90645d
Win32: shared memory base addresses and remapping.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4570
diff
changeset
|
95 * Order of shared memory zones may be different in the master process |
af7eba90645d
Win32: shared memory base addresses and remapping.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4570
diff
changeset
|
96 * and worker processes after reconfiguration. As a result, the above |
af7eba90645d
Win32: shared memory base addresses and remapping.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4570
diff
changeset
|
97 * may fail due to a conflict with a previously created mapping remapped |
af7eba90645d
Win32: shared memory base addresses and remapping.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4570
diff
changeset
|
98 * to a different address. Additionally, there may be a conflict with |
af7eba90645d
Win32: shared memory base addresses and remapping.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4570
diff
changeset
|
99 * some other uses of the memory. In this case we retry without a base |
af7eba90645d
Win32: shared memory base addresses and remapping.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4570
diff
changeset
|
100 * address to let the system assign the address itself. |
af7eba90645d
Win32: shared memory base addresses and remapping.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4570
diff
changeset
|
101 */ |
af7eba90645d
Win32: shared memory base addresses and remapping.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4570
diff
changeset
|
102 |
605 | 103 shm->addr = MapViewOfFile(shm->handle, FILE_MAP_WRITE, 0, 0, 0); |
104 | |
2720
b3b8c66bd520
support attaching to an existent Win32 shared memory
Igor Sysoev <igor@sysoev.ru>
parents:
2716
diff
changeset
|
105 if (shm->addr != NULL) { |
b3b8c66bd520
support attaching to an existent Win32 shared memory
Igor Sysoev <igor@sysoev.ru>
parents:
2716
diff
changeset
|
106 return NGX_OK; |
605 | 107 } |
108 | |
2720
b3b8c66bd520
support attaching to an existent Win32 shared memory
Igor Sysoev <igor@sysoev.ru>
parents:
2716
diff
changeset
|
109 ngx_log_error(NGX_LOG_ALERT, shm->log, ngx_errno, |
2904
474a9daf8c80
*) fix memory leak in successful case
Igor Sysoev <igor@sysoev.ru>
parents:
2903
diff
changeset
|
110 "MapViewOfFile(%uz) of file mapping \"%V\" failed", |
474a9daf8c80
*) fix memory leak in successful case
Igor Sysoev <igor@sysoev.ru>
parents:
2903
diff
changeset
|
111 shm->size, &shm->name); |
2720
b3b8c66bd520
support attaching to an existent Win32 shared memory
Igor Sysoev <igor@sysoev.ru>
parents:
2716
diff
changeset
|
112 |
b3b8c66bd520
support attaching to an existent Win32 shared memory
Igor Sysoev <igor@sysoev.ru>
parents:
2716
diff
changeset
|
113 if (CloseHandle(shm->handle) == 0) { |
b3b8c66bd520
support attaching to an existent Win32 shared memory
Igor Sysoev <igor@sysoev.ru>
parents:
2716
diff
changeset
|
114 ngx_log_error(NGX_LOG_ALERT, shm->log, ngx_errno, |
2904
474a9daf8c80
*) fix memory leak in successful case
Igor Sysoev <igor@sysoev.ru>
parents:
2903
diff
changeset
|
115 "CloseHandle() of file mapping \"%V\" failed", |
474a9daf8c80
*) fix memory leak in successful case
Igor Sysoev <igor@sysoev.ru>
parents:
2903
diff
changeset
|
116 &shm->name); |
2720
b3b8c66bd520
support attaching to an existent Win32 shared memory
Igor Sysoev <igor@sysoev.ru>
parents:
2716
diff
changeset
|
117 } |
b3b8c66bd520
support attaching to an existent Win32 shared memory
Igor Sysoev <igor@sysoev.ru>
parents:
2716
diff
changeset
|
118 |
b3b8c66bd520
support attaching to an existent Win32 shared memory
Igor Sysoev <igor@sysoev.ru>
parents:
2716
diff
changeset
|
119 return NGX_ERROR; |
605 | 120 } |
121 | |
122 | |
6133
af7eba90645d
Win32: shared memory base addresses and remapping.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4570
diff
changeset
|
123 ngx_int_t |
af7eba90645d
Win32: shared memory base addresses and remapping.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4570
diff
changeset
|
124 ngx_shm_remap(ngx_shm_t *shm, u_char *addr) |
af7eba90645d
Win32: shared memory base addresses and remapping.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4570
diff
changeset
|
125 { |
af7eba90645d
Win32: shared memory base addresses and remapping.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4570
diff
changeset
|
126 if (UnmapViewOfFile(shm->addr) == 0) { |
af7eba90645d
Win32: shared memory base addresses and remapping.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4570
diff
changeset
|
127 ngx_log_error(NGX_LOG_ALERT, shm->log, ngx_errno, |
af7eba90645d
Win32: shared memory base addresses and remapping.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4570
diff
changeset
|
128 "UnmapViewOfFile(%p) of file mapping \"%V\" failed", |
af7eba90645d
Win32: shared memory base addresses and remapping.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4570
diff
changeset
|
129 shm->addr, &shm->name); |
af7eba90645d
Win32: shared memory base addresses and remapping.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4570
diff
changeset
|
130 return NGX_ERROR; |
af7eba90645d
Win32: shared memory base addresses and remapping.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4570
diff
changeset
|
131 } |
af7eba90645d
Win32: shared memory base addresses and remapping.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4570
diff
changeset
|
132 |
af7eba90645d
Win32: shared memory base addresses and remapping.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4570
diff
changeset
|
133 shm->addr = MapViewOfFileEx(shm->handle, FILE_MAP_WRITE, 0, 0, 0, addr); |
af7eba90645d
Win32: shared memory base addresses and remapping.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4570
diff
changeset
|
134 |
af7eba90645d
Win32: shared memory base addresses and remapping.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4570
diff
changeset
|
135 if (shm->addr != NULL) { |
af7eba90645d
Win32: shared memory base addresses and remapping.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4570
diff
changeset
|
136 return NGX_OK; |
af7eba90645d
Win32: shared memory base addresses and remapping.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4570
diff
changeset
|
137 } |
af7eba90645d
Win32: shared memory base addresses and remapping.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4570
diff
changeset
|
138 |
af7eba90645d
Win32: shared memory base addresses and remapping.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4570
diff
changeset
|
139 ngx_log_error(NGX_LOG_ALERT, shm->log, ngx_errno, |
af7eba90645d
Win32: shared memory base addresses and remapping.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4570
diff
changeset
|
140 "MapViewOfFileEx(%uz, %p) of file mapping \"%V\" failed", |
af7eba90645d
Win32: shared memory base addresses and remapping.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4570
diff
changeset
|
141 shm->size, addr, &shm->name); |
af7eba90645d
Win32: shared memory base addresses and remapping.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4570
diff
changeset
|
142 |
af7eba90645d
Win32: shared memory base addresses and remapping.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4570
diff
changeset
|
143 return NGX_ERROR; |
af7eba90645d
Win32: shared memory base addresses and remapping.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4570
diff
changeset
|
144 } |
af7eba90645d
Win32: shared memory base addresses and remapping.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4570
diff
changeset
|
145 |
af7eba90645d
Win32: shared memory base addresses and remapping.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4570
diff
changeset
|
146 |
605 | 147 void |
148 ngx_shm_free(ngx_shm_t *shm) | |
149 { | |
150 if (UnmapViewOfFile(shm->addr) == 0) { | |
151 ngx_log_error(NGX_LOG_ALERT, shm->log, ngx_errno, | |
2904
474a9daf8c80
*) fix memory leak in successful case
Igor Sysoev <igor@sysoev.ru>
parents:
2903
diff
changeset
|
152 "UnmapViewOfFile(%p) of file mapping \"%V\" failed", |
474a9daf8c80
*) fix memory leak in successful case
Igor Sysoev <igor@sysoev.ru>
parents:
2903
diff
changeset
|
153 shm->addr, &shm->name); |
605 | 154 } |
155 | |
156 if (CloseHandle(shm->handle) == 0) { | |
157 ngx_log_error(NGX_LOG_ALERT, shm->log, ngx_errno, | |
2904
474a9daf8c80
*) fix memory leak in successful case
Igor Sysoev <igor@sysoev.ru>
parents:
2903
diff
changeset
|
158 "CloseHandle() of file mapping \"%V\" failed", |
474a9daf8c80
*) fix memory leak in successful case
Igor Sysoev <igor@sysoev.ru>
parents:
2903
diff
changeset
|
159 &shm->name); |
605 | 160 } |
161 } |