Commit 43ebb82
committed
[breaking] Change the prototype of [caml_atomic_cas_field].
This is a breaking change because this function was (unfortunately)
exposed outside CAML_INTERNALS, and is used by exactly one external
user, you guessed it:
https://github.com/ocaml-multicore/multicore-magic/blob/360c2e829c9addeca9ccaee1c71f4ad36bb14a79/src/Multicore_magic.mli#L181-L185
https://github.com/ocaml-multicore/multicore-magic/blob/360c2e829c9addeca9ccaee1c71f4ad36bb14a79/src/unboxed5/multicore_magic_atomic_array.ml#L36-L43
We chose to change the prototype to remain consistent with the naming
convention for the new caml_atomic_*_field primitives, which will be
added to support atomic record fields.
User code can easily adapt to this new prototype we are using, but not
in a way that is compatible with both old and new versions of
OCaml (not without some preprocessing at least).
Another option would be to expose
int caml_atomic_cas_field(value obj, intnat fld, value, value)
value caml_atomic_cas_field_boxed(value obj, value vfld, value, value)
but no other group of primitives in the runtime uses this _boxed
terminology, they instead use
int caml_atomic_cas_field_unboxed(value obj, intnat fld, value, value)
value caml_atomic_cas_field(value obj, value vfld, value, value)
and this would again break compatiblity -- it is not easier to convert
code to that two-version proposal, and not noticeably more efficient.
So in this case we decided to break compatibility (of an obscure,
experimental, undocumented but exposed feature) in favor of
consistency and simplificity of the result.1 parent 8c4bd1a commit 43ebb82
3 files changed
+11
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
345 | 345 | | |
346 | 346 | | |
347 | 347 | | |
348 | | - | |
349 | | - | |
| 348 | + | |
| 349 | + | |
350 | 350 | | |
| 351 | + | |
351 | 352 | | |
352 | 353 | | |
353 | 354 | | |
354 | 355 | | |
355 | 356 | | |
356 | 357 | | |
357 | | - | |
| 358 | + | |
358 | 359 | | |
359 | | - | |
| 360 | + | |
360 | 361 | | |
361 | 362 | | |
362 | 363 | | |
| |||
365 | 366 | | |
366 | 367 | | |
367 | 368 | | |
368 | | - | |
| 369 | + | |
369 | 370 | | |
370 | | - | |
| 371 | + | |
371 | 372 | | |
372 | 373 | | |
373 | 374 | | |
374 | 375 | | |
375 | 376 | | |
376 | | - | |
| 377 | + | |
377 | 378 | | |
378 | 379 | | |
379 | 380 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
176 | | - | |
| 176 | + | |
177 | 177 | | |
178 | | - | |
| 178 | + | |
179 | 179 | | |
180 | 180 | | |
181 | 181 | | |
| |||
0 commit comments