Skip to content

Commit

Permalink
v0.17~preview.128.37+01
Browse files Browse the repository at this point in the history
  • Loading branch information
public-release committed Aug 30, 2023
1 parent 842bb24 commit c2545a2
Show file tree
Hide file tree
Showing 14 changed files with 106 additions and 106 deletions.
12 changes: 6 additions & 6 deletions src/applicative_intf.ml
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ module type S_local =
S_gen
with type ('a, 'b) fn := ('a[@local]) -> 'b
and type ('a, 'b) f_labeled_fn := f:('a[@local]) -> 'b
and type ('a, 'b, 'c) fun2 := 'a -> ('b -> 'c[@local])
and type ('a, 'b, 'c, 'd) fun3 := 'a -> ('b -> ('c -> 'd[@local])[@local])
and type ('a, 'b, 'c) fun2 := 'a -> (('b -> 'c)[@local])
and type ('a, 'b, 'c, 'd) fun3 := 'a -> (('b -> (('c -> 'd)[@local]))[@local])

module type Let_syntax = sig
type 'a t
Expand Down Expand Up @@ -270,8 +270,8 @@ module type S2_local =
S2_gen
with type ('a, 'b) fn := ('a[@local]) -> 'b
and type ('a, 'b) f_labeled_fn := f:('a[@local]) -> 'b
and type ('a, 'b, 'c) fun2 := 'a -> ('b -> 'c[@local])
and type ('a, 'b, 'c, 'd) fun3 := 'a -> ('b -> ('c -> 'd[@local])[@local])
and type ('a, 'b, 'c) fun2 := 'a -> (('b -> 'c)[@local])
and type ('a, 'b, 'c, 'd) fun3 := 'a -> (('b -> (('c -> 'd)[@local]))[@local])

module type Let_syntax2 = sig
type ('a, 'e) t
Expand Down Expand Up @@ -413,8 +413,8 @@ module type S3_local =
S3_gen
with type ('a, 'b) fn := ('a[@local]) -> 'b
and type ('a, 'b) f_labeled_fn := f:('a[@local]) -> 'b
and type ('a, 'b, 'c) fun2 := 'a -> ('b -> 'c[@local])
and type ('a, 'b, 'c, 'd) fun3 := 'a -> ('b -> ('c -> 'd[@local])[@local])
and type ('a, 'b, 'c) fun2 := 'a -> (('b -> 'c)[@local])
and type ('a, 'b, 'c, 'd) fun3 := 'a -> (('b -> (('c -> 'd)[@local]))[@local])

module type Let_syntax3 = sig
type ('a, 'd, 'e) t
Expand Down
4 changes: 2 additions & 2 deletions src/array0.ml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ let invalid_argf = Printf.invalid_argf

module Array = struct
external create : int -> 'a -> 'a array = "caml_make_vect"
external create_local : int -> 'a -> ('a array[@local]) = "caml_make_vect"
external create_local : int -> 'a -> ('a array[@local]) = "caml_make_local_vect"
external create_float_uninitialized : int -> float array = "caml_make_float_vect"
external get : ('a array[@local_opt]) -> (int[@local_opt]) -> 'a = "%array_safe_get"
external length : ('a array[@local_opt]) -> int = "%array_length"
Expand Down Expand Up @@ -60,7 +60,7 @@ let create ~len x =
;;

let create_local ~len x =

[%local]
(try create_local len x with
| Invalid_argument _ ->
invalid_argf "Array.create_local ~len:%d: invalid length" len ())
Expand Down
2 changes: 1 addition & 1 deletion src/bytes0.ml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ external unsafe_create_local : int -> (bytes[@local]) = "Base_unsafe_create_loca
[@@noalloc]

let create_local len =

[%ocaml.local]
(if len > Sys0.max_string_length then invalid_arg "Bytes.create_local";
unsafe_create_local len)
;;
Expand Down
2 changes: 1 addition & 1 deletion src/bytes_stubs.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
call noalloc. */
CAMLprim value Base_unsafe_create_local_bytes(value len) {
mlsize_t size = Long_val(len);
return caml_alloc_string(size);
return caml_alloc_local_string(size);
}
14 changes: 7 additions & 7 deletions src/globalize.ml
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@ let globalize_char = function
| '\x00' .. '\xFF' as c -> c
;;

external globalize_float : (float[@local]) -> float = "caml_obj_dup"
external globalize_float : (float[@local]) -> float = "%obj_dup"
external globalize_int : (int[@local]) -> int = "%identity"
external globalize_int32 : (int32[@local]) -> int32 = "caml_obj_dup"
external globalize_int64 : (int64[@local]) -> int64 = "caml_obj_dup"
external globalize_nativeint : (nativeint[@local]) -> nativeint = "caml_obj_dup"
external globalize_bytes : (bytes[@local]) -> bytes = "caml_obj_dup"
external globalize_string : (string[@local]) -> string = "caml_obj_dup"
external globalize_int32 : (int32[@local]) -> int32 = "%obj_dup"
external globalize_int64 : (int64[@local]) -> int64 = "%obj_dup"
external globalize_nativeint : (nativeint[@local]) -> nativeint = "%obj_dup"
external globalize_bytes : (bytes[@local]) -> bytes = "%obj_dup"
external globalize_string : (string[@local]) -> string = "%obj_dup"

let globalize_unit (() as u) = u

external globalize_array' : ('a array[@local]) -> 'a array = "caml_obj_dup"
external globalize_array' : ('a array[@local]) -> 'a array = "%obj_dup"

let globalize_array _ a = globalize_array' a

Expand Down
4 changes: 2 additions & 2 deletions src/hashtbl.ml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ let slot t key =
let add_worker t ~replace ~key ~data =
let i = slot t key in
let root = t.table.(i) in
let added = (ref false) in
let added = [%local] (ref false) in
let new_root =
(* The avl tree might replace the value [replace=true] or do nothing [replace=false]
to the entry, in that case the table did not get bigger, so we should not
Expand Down Expand Up @@ -234,7 +234,7 @@ let remove t key =
ensure_mutation_allowed t;
let i = slot t key in
let root = t.table.(i) in
let added_or_removed = (ref false) in
let added_or_removed = [%local] (ref false) in
let new_root =
Avltree.remove root ~removed:added_or_removed ~compare:(compare_key t) key
in
Expand Down
Loading

0 comments on commit c2545a2

Please sign in to comment.