<div dir="ltr"><div>Hello!</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Apr 19, 2022 at 7:17 AM Vitor Rocha <<a href="mailto:vitor.vrs@gmail.com">vitor.vrs@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>(1) how do I know if my code is actually being executed as interpreted or native?</div></div></blockquote><div><br></div><div>All code loaded from .beam files are run natively if the VM supports JIT compilation.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>(2) If I compile a module inside Erlang's shell, using the `c:c/1` function, is the module going to be compiled to native too? Will its execution be switched to native?<br></div></div></blockquote><div><br></div><div>There is no difference in how it is compiled, it will always be translated into native code when loaded.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div></div><div>(3) Where is stored the generated beamasm native code? I would like to get its size in bytes?<br></div></div></blockquote><div><br></div><div>It is stored in memory of the VM. You can get a file dump of the native code by passing `+JDdump true` when starting `erl`. There is no way to get the loaded memory size of a single module, but you can get a relatively close value by checking what `erlang:memory(code)` returns before and after the module is loaded.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><br></div><div>-- <br><div dir="ltr"><span style="font-family:"trebuchet ms",sans-serif">Atenciosamente,<br>Vitor Rocha da Silva</span><br></div></div></div>
</blockquote></div></div>