Skip to content

Commit

Permalink
Add ml_z_extract_small JS stub (#896)
Browse files Browse the repository at this point in the history
ml_z_extract_small was added as a fast path in ZArith 1.13. It is not
(yet) supported by zarith_stubs_js. Since it is a fast path for
ml_z_extract, we can simply call ml_z_extract in missing_primitives.js
for the time being.

Fixes #895
  • Loading branch information
bclement-ocp authored Oct 16, 2023
1 parent 03421e1 commit dca4a1b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/lib/missing_primitives.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,11 @@ function unix_getpid() {
function unix_kill() {
return 0;
}

// Fast path in ZArith 1.13, not in zarith_stubs_js
// https://github.com/janestreet/zarith_stubs_js/issues/10
// Provides: ml_z_extract_small
// Requires: ml_z_extract
function ml_z_extract_small(z1, pos, len) {
return ml_z_extract(z1, pos, len);
}

0 comments on commit dca4a1b

Please sign in to comment.