Skip to content

Commit

Permalink
Merge pull request #133 from inhabitedtype/js-annot
Browse files Browse the repository at this point in the history
js-annot: add Provides and Requires annotations to js file
  • Loading branch information
seliopou authored Feb 11, 2018
2 parents 838f53c + 1055904 commit 23bb584
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions lib/runtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,26 @@
POSSIBILITY OF SUCH DAMAGE.
----------------------------------------------------------------------------*/

//Provides: angstrom_bigstring_blit_to_bytes
//Requires: caml_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));
caml_string_unsafe_set(dst, dst_off + i, caml_ba_get_1(src, src_off + i));
}
}

//Provides: angstrom_bigstring_blit_to_bigstring
//Requires: caml_ba_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_set_1, caml_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, dst_off + i, caml_string_unsafe_get(src, src_off + i));
}
}

0 comments on commit 23bb584

Please sign in to comment.