Closed lukaszsamson closed 4 years ago
Looking though the Erlang repository the only thing that changed recently in binary.erl is:
Since we are dealing with strings (character lists) is it possible that we no longer need to decide between:
defp string_decode_function(%{strings: :copy}), do: &:binary.copy/1
defp string_decode_function(%{strings: :reference}), do: &(&1)
I would be willing to write a merge request, or help contribute. Any thoughts from the maintainers?
This possibly comes from some changes in the GC. This test is generally very implementation-dependent, but I don't really have an idea how to test it otherwise. The differentiation is probably still needed, though, I wouldn't trust the default behaviour without explicit :binary.copy/1
calls. It's possible we just need to operate on bigger strings in the test instead of just 4 characters.
OTP version: Erlang/OTP 22 [erts-10.6.4] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [hipe] Elixir version: 1.8, 1.9, 1.10 Jason version: master@70b046aee882ca789bebf3a7d173e6259f3fa8aa
The following tests fails.
It looks like OTP 22 introduced some change in binary refcounting.