Skip to content
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

Fully initialize custom_operations job_ops #918

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
* Use the WSA_FLAG_NO_HANDLE_INHERIT on Windows when creating sockets with WSASocket if the cloexec (non-inheritable) parameter is true. Fixes a Windows problem where a child process would inherit a supposedly non-inheritable socket. (#910, Antonin Décimo)
* Fix macOS/arm64 tests which have a 16k page. (#932, Kate Deplaix)
* Fix Lwt_unix.closedir incorrectly checking the return value of closedir(3). (#942, Antonin Décimo)
* Fix custom_operations struct not fully initialized after OCaml 4.08. (Antonin Décimo, #918)

====== Deprecations ======

Expand Down
10 changes: 8 additions & 2 deletions src/unix/lwt_libev_stubs.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,10 @@ static long hash_loop(value loop) { return (long)Ev_loop_val(loop); }

static struct custom_operations loop_ops = {
"lwt.libev.loop", custom_finalize_default, compare_loops,
hash_loop, custom_serialize_default, custom_deserialize_default};
hash_loop, custom_serialize_default, custom_deserialize_default,
custom_compare_ext_default,
NULL
};

/* Do nothing.

Expand Down Expand Up @@ -125,7 +128,10 @@ static long hash_watcher(value watcher) { return (long)Ev_io_val(watcher); }

static struct custom_operations watcher_ops = {
"lwt.libev.watcher", custom_finalize_default, compare_watchers,
hash_watcher, custom_serialize_default, custom_deserialize_default};
hash_watcher, custom_serialize_default, custom_deserialize_default,
custom_compare_ext_default,
NULL
};

/* +-----------------------------------------------------------------+
| IO watchers |
Expand Down
5 changes: 4 additions & 1 deletion src/unix/lwt_unix_stubs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1021,7 +1021,10 @@ static void *worker_loop(void *data) {
/* Description of jobs. */
struct custom_operations job_ops = {
"lwt.unix.job", custom_finalize_default, custom_compare_default,
custom_hash_default, custom_serialize_default, custom_deserialize_default};
custom_hash_default, custom_serialize_default, custom_deserialize_default,
custom_compare_ext_default,
NULL
};

/* Get the job structure contained in a custom value. */
#define Job_val(v) *(lwt_unix_job *)Data_custom_val(v)
Expand Down