gpt4 book ai didi

c - 为什么 mruby 会提高 "arena overflow error"?

转载 作者:行者123 更新时间:2023-11-30 17:44:34 24 4
gpt4 key购买 nike

当我在 MRuby 代码中进行救援时,我收到此错误:

arena overflow error

我不熟悉这个术语以及如何解决它。这是我的 C 程序的示例:

while (true) {
SDL_Event event;
if (SDL_PollEvent(&event)) {
if (event.type == SDL_QUIT) break; //exit the loop

switch(event.type) {
case SDL_KEYDOWN:
if (event.key.keysym.sym == SDLK_LEFT) { key = "left"; code = "input_received(:left)"; }
//...
printf("Key down: %s\n", key);
mrb_load_string(mrb, code);
break;
}
}

// Re-render each iteration
mrb_load_string(mrb, "render()"); //<-- this is the line that causes the error
}

最佳答案

阻止使用 mrb_gc_arena_save/mrb_gc_arena_restore 分配临时对象的代码。

int ai = mrb_gc_arena_save(mrb);
// creating temporary objects
mrb_gc_arena_restore(mrb, ai);

关于c - 为什么 mruby 会提高 "arena overflow error"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19939951/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com