Commit b5dfcd1
Fix pool header block problem
Summary:
There seems to be a bug in the pool allocation regarding the header block in the scenario where no words are left (besides the header word).
Added a panic in the scenario I believe is broken and where the null terminating word is actually overwriting the header word.
In OCaml, any heap block has to be at least 2 words (1 header + one block word). The ocamlpool code needs to change so that when we cannot allocate the next block, there is one word left in the pool (in addition to the reserved header word).
That way, the zero terminator can be properly written in the String_tagged header block.
Reviewed By: rjbailey
Differential Revision: D52574962
fbshipit-source-id: 41795b3900551627e444cf627ad8642745a184341 parent 6c3a04c commit b5dfcd1
1 file changed
+6
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
121 | | - | |
| 121 | + | |
| 122 | + | |
122 | 123 | | |
123 | 124 | | |
124 | 125 | | |
| |||
135 | 136 | | |
136 | 137 | | |
137 | 138 | | |
| 139 | + | |
138 | 140 | | |
139 | 141 | | |
140 | 142 | | |
| |||
253 | 255 | | |
254 | 256 | | |
255 | 257 | | |
256 | | - | |
257 | | - | |
| 258 | + | |
| 259 | + | |
258 | 260 | | |
259 | 261 | | |
260 | 262 | | |
| |||
276 | 278 | | |
277 | 279 | | |
278 | 280 | | |
279 | | - | |
| 281 | + | |
280 | 282 | | |
281 | 283 | | |
282 | 284 | | |
| |||
0 commit comments