Commit d6e8e37
buffer: implement Uint8Array backed Buffer
With V8 4.4 removing the external array data API currently used by
Buffer, the new implementation uses the Uint8Array to back Buffer.
Buffers now have a maximum size of Smi::kMaxLength, as defined by V8.
Which is ~2 GB on 64 bit and ~1 GB on 32 bit.
The flag --use-old-buffer allows using the old Buffer implementation.
This flag will be removed once V8 4.4 has landed.
The two JS Buffer implementations have been split into two files for
simplicity.
Use getter to return expected .parent/.offset values for backwards
compatibility.
PR-URL: #1825
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>1 parent 804f3a0 commit d6e8e37
File tree
13 files changed
+2521
-1252
lines changed- lib
- internal
- src
- test/parallel
13 files changed
+2521
-1252
lines changedLarge diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
73 | 72 | | |
| 73 | + | |
| 74 | + | |
74 | 75 | | |
75 | 76 | | |
76 | 77 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
231 | 231 | | |
232 | 232 | | |
233 | 233 | | |
| 234 | + | |
234 | 235 | | |
235 | 236 | | |
236 | 237 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
147 | 148 | | |
148 | 149 | | |
149 | 150 | | |
| 151 | + | |
| 152 | + | |
150 | 153 | | |
151 | 154 | | |
152 | 155 | | |
| |||
166 | 169 | | |
167 | 170 | | |
168 | 171 | | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
| 172 | + | |
174 | 173 | | |
175 | 174 | | |
176 | 175 | | |
177 | 176 | | |
178 | | - | |
179 | | - | |
180 | | - | |
| 177 | + | |
181 | 178 | | |
182 | 179 | | |
183 | 180 | | |
184 | 181 | | |
185 | | - | |
| 182 | + | |
186 | 183 | | |
187 | 184 | | |
188 | 185 | | |
| |||
2836 | 2833 | | |
2837 | 2834 | | |
2838 | 2835 | | |
| 2836 | + | |
| 2837 | + | |
| 2838 | + | |
| 2839 | + | |
| 2840 | + | |
2839 | 2841 | | |
2840 | 2842 | | |
2841 | 2843 | | |
| |||
3067 | 3069 | | |
3068 | 3070 | | |
3069 | 3071 | | |
| 3072 | + | |
3070 | 3073 | | |
3071 | 3074 | | |
3072 | 3075 | | |
| |||
3204 | 3207 | | |
3205 | 3208 | | |
3206 | 3209 | | |
| 3210 | + | |
| 3211 | + | |
| 3212 | + | |
| 3213 | + | |
3207 | 3214 | | |
3208 | 3215 | | |
3209 | 3216 | | |
| |||
0 commit comments