Skip to content

Instantly share code, notes, and snippets.

@clod81
Created November 3, 2017 00:50
Show Gist options
  • Save clod81/9c8459b87910919ac2c3100fcb3ab783 to your computer and use it in GitHub Desktop.
Save clod81/9c8459b87910919ac2c3100fcb3ab783 to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <mruby.h>
#include <mruby/array.h>
#include <mruby/compile.h>
#include <mruby/dump.h>
#include <mruby/variable.h>
int main(int argc, char *argv[])
{
if(argc < 2) { puts("Filename not supplied as param!"); exit(1); }
mrb_state *mrb = mrb_open();
if (!mrb) { puts("Could not get mrb!"); exit(1); }
// Lets make it persistent.
// This increases speed from 90/s to ~1200/s.
while(__AFL_LOOP(1000))
{
FILE *f = fopen(argv[1], "r");
mrb_load_file(mrb, f);
}
mrb_close(mrb);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment