just a few small questions

MM MM_member at pathlink.com
Tue Apr 18 16:45:35 PDT 2006


>I think you are best off using the heap for your large global array. 
>Data placed on the heap stays there until you explicitly delete it, so 
>you don't have to use a global. Heap is also what you use if you have 
>any sort of dynamic memory needs, you can allocate what you need when 
>you need it. If you use new/delete to much, the heap may become 
>segmented and then the garbage collector will run (I think). The heap is 
>unlimited for the most part, while you can only allocate so much data 
>onto the stack. The heap might be slower to access, but not enough to be 
>a significant problem.
>
>Maybe an expert can vindicate my post?
>~ Clay

Why is wrong with using a Global? When I need an array for the whole time and
more than half of the subs need to access it, I just don't want to use those
annoying pointers the whole time :).. how is this done in D?





More information about the Digitalmars-d-learn mailing list