Skip to content

Instantly share code, notes, and snippets.

@dch
Forked from nox/prealloc_bin.S
Created February 18, 2014 15:49
Show Gist options
  • Select an option

  • Save dch/9073560 to your computer and use it in GitHub Desktop.

Select an option

Save dch/9073560 to your computer and use it in GitHub Desktop.

Revisions

  1. @nox nox created this gist Apr 10, 2013.
    40 changes: 40 additions & 0 deletions prealloc_bin.S
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,40 @@
    {module, prealloc_bin}. %% version = 0

    {exports, [{module_info,0},{module_info,1},{new,1}]}.

    {attributes, []}.

    {labels, 7}.


    {function, new, 1, 2}.
    {label,1}.
    {line,[{location,"prealloc_bin.S",13}]}.
    {func_info,{atom,prealloc_bin},{atom,new},1}.
    {label,2}.
    {line,[{location,"prealloc_bin.S",16}]}.
    {test,is_integer,{f,1},[{x,0}]}.
    {test,is_ge,{f,1},[{x,0},{integer,0}]}.
    bs_init_writable.
    return.


    {function, module_info, 0, 4}.
    {label,3}.
    {line,[]}.
    {func_info,{atom,t},{atom,module_info},0}.
    {label,4}.
    {move,{atom,t},{x,0}}.
    {line,[]}.
    {call_ext_only,1,{extfunc,erlang,get_module_info,1}}.


    {function, module_info, 1, 6}.
    {label,5}.
    {line,[]}.
    {func_info,{atom,t},{atom,module_info},1}.
    {label,6}.
    {move,{x,0},{x,1}}.
    {move,{atom,t},{x,0}}.
    {line,[]}.
    {call_ext_only,2,{extfunc,erlang,get_module_info,2}}.