Skip to content

Commit

Permalink
js-annot: use intrinsics that are available in js
Browse files Browse the repository at this point in the history
  • Loading branch information
seliopou committed Feb 10, 2018
1 parent 6834ad8 commit 8b83e7c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/runtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,25 +32,25 @@
----------------------------------------------------------------------------*/

//Provides: angstrom_bigstring_blit_to_bytes
//Requires: string_unsafe_set, caml_ba_unsafe_ref_1
//Requires: string_unsafe_set, caml_ba_get_1
function angstrom_bigstring_blit_to_bytes(src, src_off, dst, dst_off, len) {
for (var i = 0; i < len; i++) {
string_unsafe_set(dst, dst_off + i, caml_ba_unsafe_ref_1(src, src_off + i));
string_unsafe_set(dst, dst_off + i, caml_ba_get_1(src, src_off + i));
}
}

//Provides: angstrom_bigstring_blit_to_bigstring
//Requires: caml_ba_unsafe_set_1, caml_ba_unsafe_ref_1
//Requires: caml_ba_unsafe_set_1, caml_ba_get_1
function angstrom_bigstring_blit_to_bigstring(src, src_off, dst, dst_off, len) {
for (var i = 0; i < len; i++) {
caml_ba_unsafe_set_1(dst, dst_off + i, caml_ba_unsafe_ref_1(src, src_off + i));
caml_ba_set_1(dst, dst_off + i, caml_ba_get_1(src, src_off + i));
}
}

//Provides: angstrom_bigstring_blit_from_bytes
//Requires: caml_ba_unsafe_set_1, string_unsafe_get
//Requires: caml_ba_set_1, string_unsafe_get
function angstrom_bigstring_blit_from_bytes(src, src_off, dst, dst_off, len) {
for (var i = 0; i < len; i++) {
caml_ba_unsafe_set_1(dst, dstoff + i, string_unsafe_get(src, src_off + i));
caml_ba_set_1(dst, dstoff + i, string_unsafe_get(src, src_off + i));
}
}

0 comments on commit 8b83e7c

Please sign in to comment.