HeapCreate and David McMinn's Double Linked Lists

Windows specific forum
tony
User
User
Posts: 26
Joined: Thu May 01, 2003 1:35 am
Location: California
Contact:

HeapCreate and David McMinn's Double Linked Lists

Post 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
User avatar
tinman
PureBasic Expert
PureBasic Expert
Posts: 1102
Joined: Sat Apr 26, 2003 4:56 pm
Location: Level 5 of Robot Hell
Contact:

Re: HeapCreate and David McMinn's Double Linked Lists

Post 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.
If you paint your butt blue and glue the hole shut you just themed your ass but lost the functionality.
(WinXPhSP3 PB5.20b14)
tony
User
User
Posts: 26
Joined: Thu May 01, 2003 1:35 am
Location: California
Contact:

Post 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_()
User avatar
tinman
PureBasic Expert
PureBasic Expert
Posts: 1102
Joined: Sat Apr 26, 2003 4:56 pm
Location: Level 5 of Robot Hell
Contact:

Post 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.
If you paint your butt blue and glue the hole shut you just themed your ass but lost the functionality.
(WinXPhSP3 PB5.20b14)
User avatar
tinman
PureBasic Expert
PureBasic Expert
Posts: 1102
Joined: Sat Apr 26, 2003 4:56 pm
Location: Level 5 of Robot Hell
Contact:

Post 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.
If you paint your butt blue and glue the hole shut you just themed your ass but lost the functionality.
(WinXPhSP3 PB5.20b14)
Post Reply