fnuecke / eris

Heavy Duty Persistence for Lua 5.2 and 5.3
Other
169 stars 23 forks source link

Memory limit #24

Closed grandmaster8 closed 7 years ago

grandmaster8 commented 7 years ago

I studied OpenComputers, and I want to know how to limit memory?

fnuecke commented 7 years ago

OpenComputers uses a slightly modified version of JNLua, with a custom allocator. Depending on your use case, it is more complex than necessary; but this generally applies: to limit memory, use a custom allocator and return null when trying to allocate but it'd exceed the memory limit.

grandmaster8 commented 7 years ago

thanks for the answer! I'll watch the code!