Skip to content

Commit

Permalink
Ha made the code have heaps of whitespace for a screenshot
Browse files Browse the repository at this point in the history
  • Loading branch information
RoyalIcing committed Oct 30, 2023
1 parent 80b70a9 commit 32595c2
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions test/examples/arena.exs
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,10 @@ defmodule Examples.Arena do
Orb.snippet Orb.S32, new_ptr: I32.UnsafePointer do
new_ptr = Instruction.global_get(Orb.I32, offset_global_name)




if new_ptr + byte_count > end_offset * Orb.Memory.page_byte_size() do
unreachable!()
end





Instruction.global_set(Orb.I32, offset_global_name, new_ptr + byte_count)

new_ptr
Expand All @@ -40,6 +33,7 @@ defmodule Examples.Arena do
module_name = Module.concat(__MODULE__, unquote(name))
page_count = unquote(opts[:pages])
page_offset = Orb.Memory.pages(page_count)

offset_global_name =
String.to_atom("#{Macro.inspect_atom(:literal, module_name)}.bump_offset")

Expand All @@ -53,7 +47,6 @@ defmodule Examples.Arena do
unquote(Macro.Env.location(__CALLER__))
)


global(
do: [
{offset_global_name, page_offset * 64 * 1024}
Expand Down

0 comments on commit 32595c2

Please sign in to comment.