Skip to content

Commit

Permalink
Fixed typos in the Stack Management example (#172)
Browse files Browse the repository at this point in the history
  • Loading branch information
Vvalter authored and kobalicek committed May 8, 2017
1 parent faf7e85 commit 1370fe6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1307,7 +1307,7 @@ int main(int argc, char* argv[]) {
X86Gp p = cc.newIntPtr("p");
X86Gp i = cc.newIntPtr("i");

X86Mem stack = c.newStack(256, 4); // Allocate 256 bytes on the stack aligned to 4 bytes.
X86Mem stack = cc.newStack(256, 4); // Allocate 256 bytes on the stack aligned to 4 bytes.
X86Mem stackIdx(stack); // Copy of `stack` with `i` added.
stackIdx.setIndex(i); // stackIdx <- stack[i].
stackIdx.setSize(1); // stackIdx <- byte ptr stack[i].
Expand Down Expand Up @@ -1352,14 +1352,14 @@ int main(int argc, char* argv[]) {
cc.finalize(); // Translate and assemble the whole `cc` content.
// ----> X86Compiler is no longer needed from here and can be destroyed <----

Func fib;
Error err = rt.add(&fib, &code); // Add the generated code to the runtime.
Func func;
Error err = rt.add(&func, &code); // Add the generated code to the runtime.
if (err) return 1; // Handle a possible error returned by AsmJit.
// ----> CodeHolder is no longer needed from here and can be destroyed <----

printf("Func() -> %d\n, func()); // Test the generated code.
printf("Func() -> %d\n", func()); // Test the generated code.

rt.release(fib); // RAII, but let's make it explicit.
rt.release(func); // RAII, but let's make it explicit.
return 0;
}
```
Expand Down

0 comments on commit 1370fe6

Please sign in to comment.