Skip to content

Commit bdff466

Browse files
committed
Small textual fixes to better understand using the compiled bytecode variant.
1 parent b1c6646 commit bdff466

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

docs/articles/executing-ruby-code-with-mruby.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,11 +196,13 @@ test_symbol[] = {
196196
};
197197
~~~
198198

199-
To execute this bytecode the following boilerplate has to be written:
199+
To execute this bytecode the following boilerplate has to be written (name this
200+
file `test_stub.c`):
200201

201202
~~~c
202203
#include "mruby.h"
203204
#include "mruby/irep.h"
205+
#include "test_program.c"
204206

205207
int
206208
main(void)
@@ -217,8 +219,7 @@ This will read the bytecode from the array and executes it immediately:
217219
To compile and link:
218220
219221
~~~
220-
$ gcc -std=c99 -Imruby/include test_program.c -o test_program
221-
test_program.o mruby/build/host/lib/libmruby.a
222+
$ gcc -std=c99 -Imruby/include test_stub.c -o test_program mruby/build/host/lib/libmruby.a
222223
~~~
223224
224225
To execute:

0 commit comments

Comments
 (0)