This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%% When compiled with: erlc +bin_opt_info foo.erl | |
%% | |
%% It prints: | |
%% | |
%% foo.erl:13: Warning: NOT OPTIMIZED: compiler limitation: instruction {get_map_elements, | |
%% {f,3}, | |
%% {x,1}, | |
%% {list,[{atom,state},{x,6}]}} prevents delayed sub binary optimization | |
-module(foo). | |
-compile(export_all). | |
bar(<<Type/integer, Size:32/integer, Data/binary>> = Tail, #{state := State}) -> | |
{Type, Size, Data, Tail, State}; | |
bar(Data, #{tail := Tail}) -> | |
{Data, Tail}. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment