Xref: utzoo comp.lang.c++:6447 comp.lang.c:25885 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uunet!ns-mx!umaxc.weeg.uiowa.edu!williams From: williams@umaxc.weeg.uiowa.edu (Kent Williams) Newsgroups: comp.lang.c++,comp.lang.c Subject: Re: Zortech "limitation" Message-ID: <619@ns-mx.uiowa.edu> Date: 13 Feb 90 14:08:36 GMT References: <4895d648.20b6d@apollo.HP.COM> Sender: news@ns-mx.uiowa.edu Reply-To: williams@umaxc.weeg.uiowa.edu.UUCP (Kent Williams) Followup-To: comp.lang.c++ Distribution: usa Organization: U of Iowa, Iowa City, IA Lines: 35 C'mon, dude. We all know the Intel Processors are brain-damaged. This is pretty old news. Besides, what's the big deal about calling malloc to build a >64K two-dimensional array? On the PC, the code generated is going to be better than if Walter did you the 'favor' of giving you huge arrays. So you just do something like: something **huge_array = (something **)malloc(N*sizeof(something *)); for(int i = 0; i < N; i++) huge_array[i] = (something *)malloc(sizeof(something)*M); And the normal array subscripting semantics apply, TRANSPARENTLY, AS THOUGH THIS WERE A LANGUAGE FEATURE PUT THERE TO MAKE THINGS EASY FOR THE PROGRAMMER! How about that? In this case the code generated is something like: something& access(i,j) { basereg = *(huge_array + i) indexreg = j * sizeof(something); return *(basereg + indexreg); } Whereas if you had huge arrays its something like: something& access(i,j) { basereg = hideous_segment_calculation(huge_array,i); indexreg = hideous_segment_calculation(basereg,j); } Which would you rather have under the hood? -- Kent Williams "What's an Address Bus? How do Icons work?" williams@umaxc.weeg.uiowa.edu -- Advertisement for Time-Life Books