Skip to content

Commit

Permalink
Merge pull request mirage#70 from hannesm/no-402
Browse files Browse the repository at this point in the history
remove now superfluous conditional compilation (we don't support Caml 4.02 anymore)
  • Loading branch information
mato authored Oct 5, 2020
2 parents 0243e47 + ab2189b commit d3fa083
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions lib/bindings/alloc_pages_stubs.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,23 +46,7 @@ mirage_alloc_pages(value did_gc, value n_pages)
}
/* Explicitly zero the page before returning it */
memset(block, 0, len);

/* OCaml 4.02 introduced bigarray element type CAML_BA_CHAR,
which needs to be used - otherwise type t in io_page.ml
is different from the allocated bigarray and equality won't
hold.
Only since 4.02 there is a <caml/version.h>, thus we cannot
include it in order to detect the version of the OCaml runtime.
Instead, we use definitions which were introduced by 4.02 - and
cross fingers that they'll stay there in the future.
Once <4.02 support is removed, we should get rid of this hack.
-- hannes, 16th Feb 2015
*/
#ifdef Caml_ba_kind_val
CAMLreturn(caml_ba_alloc_dims(CAML_BA_CHAR | CAML_BA_C_LAYOUT | CAML_BA_MANAGED, 1, block, len));
#else
CAMLreturn(caml_ba_alloc_dims(CAML_BA_UINT8 | CAML_BA_C_LAYOUT | CAML_BA_MANAGED, 1, block, len));
#endif
}

CAMLprim value
Expand Down

0 comments on commit d3fa083

Please sign in to comment.