Re: Problems with EDB
- Posted by gbonvehi Feb 07, 2014
- 2373 views
This should probably be fixed ...
Yes. Although not strictly a bug, we can do better. I'd propose that if the parameter supplied is less than 1, then the library should use DEF_INIT_RECORDS.
Actually, it doesn't work with 1 neither, there must be some allocation that is not taking that into account.
I did a quick patch so if the parameter is less that DEF_INIT_RECORDS then is set to it: http://openeuphoria.org/pastey/235.wc
Cheers,
Guillermo
Edit: The init parameters should've been 0, I was trying with 1 and could reproduce the problem (there was already a check for < 1 that setted it to 1) that's why I bumped the default to DEF_INIT_RECORDS.
Edit 2: The problem actually occurs on the index part, it takes the minimum of init_records and MAX_INDEX, it cannot be less than 2 in the code, corrected patch: http://openeuphoria.org/pastey/237.wc
Edit 3: Better way to solve, no need to make init_index = 2 http://openeuphoria.org/pastey/240.wc