alexherbo2 has quit [Remote host closed the connection]
alexherbo2 has joined #ocaml
gdiazlo_caml has joined #ocaml
Leonidas_ is now known as Leonidas
Leonidas is now known as Guest7697
Guest7697 has quit [Changing host]
Guest7697 has joined #ocaml
Guest7697 is now known as Leonidas
dawids has quit [Quit: Leaving]
gdiazlo_caml has quit [Ping timeout: 246 seconds]
<adrien>
on ocaml 4, if I run two native threads, they will block if they both need to allocate or when the GC needs to run (when the code reaches an allocation point), and nothing else, right?*
<adrien>
in which case, I guess a subsequent question is whether this allocates: Int32.to_int (Int32.shift_right_logical (Murmur3.hash32 (Bigstringaf.substring ba ~off ~len:check_length)) 8)
<adrien>
especially the int32 handling
<adrien>
(also, xxhash in opam is outdated and doesn't have a to_hex function that exists in more recent versions, and AFAICT, has no way to get the value out!)
<Leonidas>
I am wondering, why does Format.set_margin Int.max_int not do anything when I use `Format.asprintf`?
<Leonidas>
Format.printf "@[<hov 2>This is a long text that I want to print aaa bbb@ ccc ddd eee @[<hov>fff gg hh iii jjjj@] kkk lll mmm n o@]";;
<Leonidas>
This gets affected by `set_margin`
<Leonidas>
Format.asprintf "@[<hov 2>This is a long text that I want to print aaa bbb@ ccc ddd eee @[<hov>fff gg hh iii jjjj@] kkk lll mmm n o@]";;
<Leonidas>
This always gets me the `\n`, unless I start with `%a` and add `Format.pp_set_margin Int.max_int`
gdiazlo_caml has joined #ocaml
<discocaml>
<otini_> > on ocaml 4, if I run two native threads, they will block if they both need to allocate or when the GC needs to run (when the code reaches an allocation point), and nothing else, right?*
<discocaml>
<otini_> adrien: yeah
gdiazlo_caml has quit [Ping timeout: 248 seconds]
<discocaml>
<otini_> > in which case, I guess a subsequent question is whether this allocates: Int32.to_int (Int32.shift_right_logical (Murmur3.hash32 (Bigstringaf.substring ba ~off ~len:check_length)) 8)
<discocaml>
<otini_> good question
<discocaml>
<otini_> int32s are boxed, no question about that
<discocaml>
<otini_> and I’m pretty sure Flambda does some allocation removal
<discocaml>
<otini_> i’m not entirely sure about non-Flambda ocamlopt
<discocaml>
<dinosaure> OCaml too if the integer does not go out of the scope of the function 🙂
<discocaml>
<dinosaure> you must check but I just figured out yesterday that OCaml became smarter about that now
<discocaml>
<otini_> ah good to know. That works for any allocated value? If it doesn’t escape, it can be optimized away?