-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Backward compatibility for Lock/Unlock
in runtime/caml/io.h
#12792
Comments
I want to see a pointer to your code in the wild using these (internal) definitions first :-) |
Of course :) Here it is. I want to get the value of channel mode (is binary?), the C function exists for that, but it is not externalised (only setting binary mode is in stdlib). And I lock channels as in the documentation is it mentioned that channels must be locked before calling |
Removing the hook machinery was fine, but I wonder if we're going to discover pre-existing C code out there which uses the locking macros when the 5.2 dev cycle starts? I don't think we checked that aspect at the time? |
I don't mind putting the macros back. The reasoning was that the macros are behind the CAML_INTERNALS macros so they are not supposed to be used outside the runtime, or at least we do not provide compatibility guarantees. Note: opamWindows.c does use CAML_INTERNALS, and the list of reasons why it needs the macro is incomplete as it does not mention those Lock macros.) (Should |
I think users of
|
Absolutely - just to be clear, I wasn't meaning that it was incorrect that they were removed, only that we may soon discover other users who were using channels from C, while hopefully knowing that that involves a potentially unstable interface.
I think these would be a good idea, yes (both |
@xavierleroy I would support this approach (serves you right, external CAML_INTERNAL users!) if supporting the previous interface came at any cost, but adding a |
Sorry if there was a misunderstanding, i didn't mean neither to propose going back to the hook macros machinery. What I had in mind was something like having (other) functions named
Doc updated :) thanks for pointing that.
But I'd be fully satisfied to have it in
It's indeed the current status of our code. I agree that one answer to this issue is "use internals at your own risk", i mainly opened it to point the backward incompatibility, and check if something could be done for it (in c runtime or stdlib). |
fixes ocaml#12792 Reported-by: Raja Boujbel <raja.boujbel@ocamlpro.com>
fixes ocaml#12792 Reported-by: Raja Boujbel <raja.boujbel@ocamlpro.com>
Channel locking was rewritten in #12446. It removed
Lock
andUnlock
macros in favor tocaml_channel_lock
andcaml_channel_unlock
functions.This makes use of those functions/macros conditioned by the OCaml version. Is it possible to have a
Lock
andUnlock
functions to keep backward compatibility and avoid conditional on OCaml version?The text was updated successfully, but these errors were encountered: