Commit 5835415
committed
Allow zero-length shared memory objects
These are allowed by POSIX and it seems more consistent/cleaner to support them
than forcing the user to treat them as a special case.
Windows does not support creating a zero-length mapping, and neither does
`mmap` on any platform, so skip those operations and assign a zero-length
buffer instead.
TODO: The way the POSIX/Windows code is interleaved inside if statements makes
for difficult to follow and deeply nested logic. It might be better to refactor
this code and keep the platform-specific logic in separate functions or
possibly even implementation classes.1 parent e33f341 commit 5835415
2 files changed
+20
-32
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
77 | | - | |
78 | | - | |
| 77 | + | |
| 78 | + | |
79 | 79 | | |
80 | 80 | | |
81 | | - | |
82 | | - | |
83 | 81 | | |
84 | 82 | | |
85 | 83 | | |
| |||
114 | 112 | | |
115 | 113 | | |
116 | 114 | | |
117 | | - | |
| 115 | + | |
| 116 | + | |
118 | 117 | | |
119 | 118 | | |
120 | 119 | | |
| |||
126 | 125 | | |
127 | 126 | | |
128 | 127 | | |
129 | | - | |
| 128 | + | |
130 | 129 | | |
131 | 130 | | |
132 | 131 | | |
| |||
156 | 155 | | |
157 | 156 | | |
158 | 157 | | |
159 | | - | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
160 | 161 | | |
161 | 162 | | |
162 | 163 | | |
| |||
180 | 181 | | |
181 | 182 | | |
182 | 183 | | |
183 | | - | |
| 184 | + | |
| 185 | + | |
184 | 186 | | |
185 | 187 | | |
186 | | - | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
187 | 192 | | |
188 | 193 | | |
189 | 194 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4447 | 4447 | | |
4448 | 4448 | | |
4449 | 4449 | | |
4450 | | - | |
4451 | | - | |
4452 | | - | |
4453 | | - | |
4454 | | - | |
4455 | | - | |
4456 | | - | |
4457 | | - | |
4458 | 4450 | | |
4459 | 4451 | | |
4460 | 4452 | | |
| |||
4871 | 4863 | | |
4872 | 4864 | | |
4873 | 4865 | | |
4874 | | - | |
4875 | | - | |
4876 | | - | |
4877 | | - | |
4878 | | - | |
4879 | | - | |
4880 | | - | |
4881 | | - | |
4882 | | - | |
4883 | | - | |
4884 | | - | |
4885 | | - | |
4886 | | - | |
4887 | | - | |
4888 | | - | |
| 4866 | + | |
| 4867 | + | |
| 4868 | + | |
| 4869 | + | |
| 4870 | + | |
| 4871 | + | |
4889 | 4872 | | |
4890 | 4873 | | |
4891 | 4874 | | |
| |||
0 commit comments