Skip to content

Commit 38a8dd3

Browse files
authored
Update patches for downstreamed AtomVM (#536)
See software-mansion-labs/FissionVM#183
1 parent f96d4c1 commit 38a8dd3

2 files changed

Lines changed: 4 additions & 7 deletions

File tree

popcorn/elixir/patches/otp/erts/erlang.erl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,8 @@
114114
fun_info_mfa/1,
115115
phash2/1,
116116
phash2/2,
117-
phash/2
117+
phash/2,
118+
md5/1
118119
]).
119120

120121
-export_type([
@@ -3201,3 +3202,5 @@ phash2(Term, N) ->
32013202
(Hash rem N).
32023203

32033204
phash(Term, N) -> phash2(Term, N) + 1.
3205+
3206+
md5(Data) -> crypto:hash(md5, Data).
Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
-module(rand).
22

3-
-export([splitmix64_next/1]).
4-
53
-compile({popcorn_patch_private, default_seed/0}).
64

75
%% Patch reason: term_to_binary used in `erlang:phash2/2' patch
@@ -13,7 +11,3 @@ default_seed() ->
1311
erlang:system_time(microsecond),
1412
erlang:unique_integer()}.
1513

16-
%% Patch reason: Replaced with native implementation that handles 64 bit rollover
17-
%% Handling in Erlang on AtomVM would require big integers support
18-
splitmix64_next(X) ->
19-
avm_rand:splitmix64_next(X).

0 commit comments

Comments
 (0)