I still say that max's memory mangement is insane.

BlitzMax Forums/BlitzMax Programming/I still say that max's memory mangement is insane.

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

"That's because he's using cyclic references = poor design."

How are cyclic references poor design? Sometimes you need to have a list of objects AND know the link that contains a particular object, and for speed reasons looping through the whole list looking for that object isn't an option.


You know just making one simple change to Max would have made my life a lot simpler by rediucing the number of cycliuc references, and that is having For EachIn return the link pointer rather than returning the object the link points to. Then you could easily get the prev and next links.

For Link = EachIn PointList
	If (Distance# + Point(Link.Value())._SegmentLength#) > Px# Then Exit
	Distance# = Distance# + Point(Link.Value())._SegmentLength#
Next


See? Much cleaner than that while loop. And you could add a third line in there to save the point pointer so you don't need to keep using Point(Link.Value()), if you needed to use that many times in the loop.