[M3commit] CVS Update: cm3

Jay Krell jkrell at elego.de
Sat Sep 29 21:30:18 CEST 2012


CVSROOT:	/usr/cvs
Changes by:	jkrell at birch.	12/09/29 21:30:18

Modified files:
	cm3/m3-sys/m3back/src/: M3C.m3 

Log message:
	cleanup struct size handling to be more efficient
	no sort -- we can unique through an array of booleans indexed by size
	Still we have linear + two allocations.
	C++ would be nlgn and one allocation.
	Not clear which is better. Linear is good. Allocations are bad.
	Still the C++/STL way is a good general design that
	so far eludes me in Modula-3. I compete here by taking advantage
	of the element type being reasonably ranged integers. If the data
	was more arbitrary, we couldn't use the array of booleans.
	Even so -- this is badness e.g. on 32bit host when compiling
	64bit code with a large struct size..need to think about this
	and probably put it back.. we shouldn't be allocating arrays whose
	size equals the size of user defined data structures..not good...
	
	(Modula-3 would be one allocation but I want to be lazy
	and have the container tell me the size. The C++ STL design
	might actually be doable in Modula-3, but I don't think m3core
	provides it. Something to work on, another time.)




More information about the M3commit mailing list