Skip to content

Commit

Permalink
[cranelift docs] Replace dot code in IR docs with generated image.
Browse files Browse the repository at this point in the history
This is how the image was generated

$ cat > heap.dot << EOF
digraph {
        node [
              shape=record,
              fontsize=10,
              fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans"
              ]
        "static" [label="mapped\npages|unmapped\npages|offset_guard\npages"]
}
EOF

$ dot -Tsvg -O heap.dot
  • Loading branch information
samrat committed Mar 17, 2020
1 parent 0036ef1 commit 4db0bcc
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 10 deletions.
8 changes: 8 additions & 0 deletions cranelift/docs/heap.dot
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
digraph {
node [
shape=record,
fontsize=10,
fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans"
]
"static" [label="mapped\npages|unmapped\npages|offset_guard\npages"]
}
26 changes: 26 additions & 0 deletions cranelift/docs/heap.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 1 addition & 10 deletions cranelift/docs/ir.md
Original file line number Diff line number Diff line change
Expand Up @@ -622,16 +622,7 @@ returns a pointer that is guaranteed to trap. Heap addresses can be smaller than
the native pointer size, for example unsigned `i32` offsets on a 64-bit
architecture.
.. digraph:: static
:align: center
:caption: Heap address space layout
node [
shape=record,
fontsize=10,
fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans"
]
"static" [label="mapped\npages|unmapped\npages|offset_guard\npages"]
![Heap address space layout](./heap.svg)
A heap appears as three consecutive ranges of address space:
Expand Down

0 comments on commit 4db0bcc

Please sign in to comment.