<commit_before>// Js_of_ocaml runtime support
// http://www.ocsigen.org/js_of_ocaml/
// Copyright (C) 2010 <NAME>
// Laboratoire PPS - CNRS Université Paris Diderot
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, with linking exception;
// either version 2.1 of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

// Weak API, but without the weak semantics

//Provides: caml_ephe_key_offset
//Version: < 4.03
var caml_ephe_key_offset = 2

//Provides: caml_ephe_key_offset
//Version: >= 4.03
var caml_ephe_key_offset = 3

//Provides: caml_ephe_data_offset
//Version: >= 4.03
var caml_ephe_data_offset = 2

//Provides: caml_weak_create
//Requires: caml_ephe_key_offset
function caml_weak_create (n) {
  var x = [251];
  x.length = caml_ephe_key_offset + n;
  return x;
}
//Provides: caml_weak_set
//Requires: caml_ephe_key_offset
function caml_weak_set(x, i, v) {
    x[caml_ephe_key_offset + i] = v;
    return 0;
}
//Provides: caml_weak_get mutable
//Requires: caml_ephe_key_offset
function caml_weak_get(x, i) {
    return (x[caml_ephe_key_offset + i ]===undefined)?0:x[caml_ephe_key_offset + i];
}
//Provides: caml_weak_get_copy mutable
//Requires: caml_weak_get
//Requires: caml_obj_dup
function caml_weak_get_copy(x, i) {
  var y = caml_weak_get(x, i);
  if (y === 0) return y;
  var z = y[1];
  if (z instanceof Array) return [0, caml_obj_dup(z)];
  return y;
}
//Provides: caml_weak_check mutable
//Requires: caml_ephe_key_offset
function caml_weak_check(x, i) {
  return x[caml_ephe_key_offset + i]!==undefined && x[caml_ephe_key_offset + i] !==0;
}

//Provides: caml_weak_blit
//Requires: caml_array_blit
//Requires: caml_ephe_key_offset
function caml_weak_blit(a1, i1, a2, i2, len) {
  caml_array_blit(a1, caml_ephe_key_offset + i1,
                  a2, caml_ephe_key_offset + i2,
                  len);
  return 0;<commit_msg>Runtime: finally fix weak.js<commit_after>// Js_of_ocaml runtime support
// http://www.ocsigen.org/js_of_ocaml/
// Copyright (C) 2010 <NAME>
// Laboratoire PPS - CNRS Université Paris Diderot
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, with linking exception;
// either version 2.1 of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

// Weak API, but without the weak semantics

//Provides: caml_ephe_key_offset
//Version: < 4.03
var caml_ephe_key_offset = 2

//Provides: caml_ephe_key_offset
//Version: >= 4.03
var caml_ephe_key_offset = 3

//Provides: caml_ephe_data_offset
//Version: >= 4.03
var caml_ephe_data_offset = 2

//Provides: caml_weak_create
//Requires: caml_ephe_key_offset
function caml_weak_create (n) {
  var x = [251,"caml_ephe_list_head"];
  x.length = caml_ephe_key_offset + n;
  return x;
}
//Provides: caml_weak_set
//Requires: caml_ephe_key_offset
function caml_weak_set(x, i, v) {
    x[caml_ephe_key_offset + i] = v;
    return 0;
}
//Provides: caml_weak_get mutable
//Requires: caml_ephe_key_offset
function caml_weak_get(x, i) {
    return (x[caml_ephe_key_offset + i ]===undefined)?0:x[caml_ephe_key_offset + i];
}
//Provides: caml_weak_get_copy mutable
//Requires: caml_weak_get
//Requires: caml_obj_dup
function caml_weak_get_copy(x, i) {
  var y = caml_weak_get(x, i);
  if (y === 0) return y;
  var z = y[1];
  if (z instanceof Array) return [0, caml_obj_dup(z)];
  return y;
}
//Provides: caml_weak_check mutable
//Requires: caml_ephe_key_offset
function caml_weak_check(x, i) {
  if(x[caml_ephe_key_offset + i]!==undefined && x[caml_ephe_key_offset + i] !==0)
    return 1;
  else
    return 0;
}

//Provides: caml_weak_blit
//Requires: caml_array_blit
//Requires: caml_ephe_key_offset
function caml_weak_blit(a1, i1, a2, i2, len) {
  // minus one because caml_array_blit works on ocaml array  
  caml_array_blit(a1, caml_ephe_key_offset + i1 - 1,
                  a2, caml_ephe_key_offset + i2 - 1,
                  len);
  return 0;
{'fraction_non_alphanumeric': 0.10499207606973059, 'fraction_numerical': 0.020602218700475437, 'mean_word_length': 3.9019417475728155, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1303840', 'n_tokens_mistral': 1918, 'n_tokens_neox': 1833, 'n_words': 554}