Closed snorfalorpagus closed 9 years ago
Originally, I believe that the underlying GLPK function for setting memory accepted a value of zero for maxing the memory. Since at least GLPK 4.52, the argument to glp_mem_limit()
must be positive---passing in zero is fatal and terminates execution.
I decided that the test case as originally written was incorrect, and disallowed setting env.mem_limit=0
(see debeef4 on the dev branch). Looking at the code for glp_mem_limit()
, any value greater than or equal to 4096 results in the same limit being put in place.
My original intent was to mirror the GLPK interface, but Environment_setmemlimit()
could be changed to allow env.mem_limit=0
as a shortcut for env.mem_limit = 4096
. Thoughts?
My opinion is that we should preserve the API established by PyGLPK, so that any existing code is not broken by the change. I think that env.mem_limit=0
should be equivalent to whatever env.mem_limit=None
does (which I think this commit achieves). Perhaps we could raise a deprecation warning?
I've merged your changes into the dev branch and updated the tests for the new behavior. If everything looks good to you, I'll merge it into master.
@bradfordboyle Looks good to me.
According to
MemoryTestCase.testMemLimit
, settingenv.mem_limit=0
is valid.