Short: Two-element datatype From: Daniel von Dincklage <vondincklage@usa.net> Date: Mon, 22 Jun 1998 00:53:36 +0200 Type: Feature State: Unclassified >> - A datatype that stores two values and can be indexed like an array. >> In situations where you need lots of small arrays (with two elements) >> this would save a lot of memory. > > Would a class/struct datatype solve this for you? An array of two-value > structs would probably be just the thing... > > (Yes, I like the name "struct", just because MudOS picked "class". ;-) Well, not really. The whole idea behind that was perfomance and saved memory. Currently, I use arrays with two (or three) members a LOT. I'm not that happy with the fact that the arrays use about twice as much memory as I'd need to store the two items for themselves. Just a memory issue. Maybe a more efficient storage method for arrays would help? No, it wouldn't. Current overhead for arrays is 2 words (3 in DEBUG), plus the malloc overhead which is unavoidable anyway. Minimum overhead would be 1 word + malloc overhead. Hmm, but maybe tuples which are copied by value? Would be a nice complement to structs.