Offset filed of buffer dose not work
Hi,
This is excellent work! We try to use it to solve some memory allocation problems. We found that when we set a value to the offset filed of a buffer (which will be regard as a fixed position buffer according to the annotation), the solver will re-allocate this buffer instead of using the offet we provided.
Did I use it wrong? Or is this still a todo feature?
Ah, yes that optional<Offset> field is confusing ... when reading solution files, we use it to store the final (fixed) offset assignment, but it's not a property that is honored by the solver. It would take some extra work if you want the solver to recognize such fixed objects and place buffers around them.
Thank you for your reply. Now I understand the meaning of offset filed. Do you have any suggestions If I want to add the feature I mentioned above?
I've just pushed a change that should add solver support for fixed offsets. Would you mind giving it a try?
That's great! I‘d like to !
Thanks for your work. I've tried this fix in our project and it works. However, we found that for some cases, minimalloc can not found a solution within the required time (which is 30s for 200 buffers), but when we use first-fit method for memory allocation, we will get right solution in very short time. Seems that the partial-allocation problem is not friendly to minimalloc? btw, I suggest that use number of backtrack times to determine whether timeout occurs because it is more stable.
There's one more change I ought to make for the "fixed offset" feature to be fully performant -- I'll let you know once it's checked in, might take me a couple days.
Just added one more check that should allow for earlier termination -- let me know if this fixes the issue (if not, I can try a few more things).