Page 1 of 1
HeapCreate and David McMinn's Double Linked Lists
Posted: Wed Jun 11, 2003 2:08 am
by tony
Hello everybody,
I am using the double linked list, and if I allocate too many of them, my program crashes (when I am asking for one more linked list)
By the way, I am not using PureBasic's linked list, but David McMinn's, and it crashes when HeapCreate_ is called.
Do you have any workaround for this?
Thanks,
Tony
Re: HeapCreate and David McMinn's Double Linked Lists
Posted: Wed Jun 11, 2003 5:39 pm
by tinman
tony wrote:Do you have any workaround for this?
No, because I wasn't aware of any problems. They work OK for me, but then I don't use many at once. If you mail me some code that you are using then I can perhaps get a better idea about what is wrong.
Posted: Wed Jun 11, 2003 6:00 pm
by tony
XIncludeFile "double_linked_lists.pb"
#MAX_LIST = 66000
Dim list.ListHeader(#MAX_LIST)
For k = 0 To 66000
dll_NewList(list(k), 4)
Next
-----
It defeats the purpose of having linked lists of linked lists. The problem is that you use a separate heap for every linked list, and I think windows doesn't like having too many call of HeapCreate_()
Posted: Wed Jun 11, 2003 7:22 pm
by tinman
tony wrote:It defeats the purpose of having linked lists of linked lists. The problem is that you use a separate heap for every linked list, and I think windows doesn't like having too many call of HeapCreate_()
The error I get is that there is not enough memory to allocate the new heap, rather than anything specific about too many calls to HeapCreate_(). I will look for a decent way to not require a new heap for each linked list.
Thanks.
Posted: Wed Jun 11, 2003 9:13 pm
by tinman
It should be fixed now. I just hacked out the heap stuff and replaced it by global stuff, because I'm not going for elegance here.
Should be on the resources site soon and my site now.
Thanks again tony.