On 10 April 2007 21:03, Diego Novillo wrote: > Dave Korn wrote on 04/10/07 15:39: > >> Reverse-traversing an array really isn't all that painful or slow! > > Instructions are not laid out in an array. Insertion and removal is > done constantly. It would be very expensive to use arrays to represent > basic blocks. Insertions and deletions are all too common.
Agh, yes. >> How about delta-linked lists? Makes your iterators bigger, but makes >> every single node smaller. > > Worth a shot, I guess. Don't recall what other properties these things had. I only just learned about them, so I may be guilty of seeing every problem as a nail :-), but there's a quick summary at: http://forums.worsethanfailure.com/forums/permalink/117726/117749/ShowThread.a spx#117749 One slight catch is we'd have to be sure all the nodes were allocated from the same 'object', perhaps an obstack or pool or heap, so that we're allowed to add/subtract/compare pointers to them without invoking undefined behaviour. cheers, DaveK -- Can't think of a witty .sigline today....