geoffleyland / rima Goto Github PK
View Code? Open in Web Editor NEWRima is a tool for formulating mathematical models
Home Page: http://rima.incremental.co.nz/
License: MIT License
Rima is a tool for formulating mathematical models
Home Page: http://rima.incremental.co.nz/
License: MIT License
Hi Geoff,
I got your repository and integrated it into luajit and I must tell you this is a wonderful work.
Doing some tests I found something that is related to a possible memory leak/issue that broke my luajit integrated stuff.
This actually happened only using ipopt and the core dump happened when the GC entered into action.
I think I have fixed it but I don't want to mess your stuff in Github :)
So I'm simply telling you what I did in the file rima_ipopt_core.cpp:
static int rima_delete(lua_State L)
{
rima_ipopt_problem *model = (rima_ipopt_problem)luaL_checkudata(L, 1, metatable_name);
model->ReleaseRef((Ipopt::Referencer*)L);
//model->~rima_ipopt_problem();
luaL_unref(L, LUA_REGISTRYINDEX, model->model_index_);
return 0;
}
basically putting the unref directly in the delete and not using the cached L_ state.
In this way this is not crashing and is not leaking.
Hope this helps and thanks for the work you shared.
Mauro
;)
As noticed by Kevin:
I also noticed an lp_solve bug. When using add_constraintex, you should initially have 0 rows, because the add functions create a new row. Hence you are ending up with double the number of rows. This is easily fixed by doing make_lp(0, cols); resize_lp(rows, cols); as resize_lp doesn't add the rows, just allocates the memory.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.