RE: [GD-General] not sure where to post this question... bit C++ implementation specific....
Brought to you by:
vexxed72
From: Richard F. <gd...@th...> - 2004-07-07 16:11:21
|
what about the dereference of the global pointer to get the address of the array? if the array was a global, then surely the address of the array would be in the instructions that access it? Would this not go so far as to compile out any const pointer arithmetic? On the PS2 and other memory issue intense machines, might not such pointer dereferencing be a real issue? ------------------ On the other hand I may be talking complete drivel. ------------------ > -----Original Message----- > From: gam...@li... > [mailto:gam...@li...] On > Behalf Of Noel Llopis > Sent: 07 July 2004 04:19 PM > To: gam...@li... > Subject: Re: [GD-General] not sure where to post this > question... bit C++ implementation specific.... > > > On Wednesday 07 July 2004 07:05 am, Richard Fabian wrote: > > > its actually more of a "didn't want to have to dereference > everytime i > > needed to access the array". speed issue... > > You do realize that, at least on a PC, it's just as fast > accessing an array on > the stack than one that was dynamically allocated, right? > Actually, if you're > accessing more than one int at the time, the > dynamically-allocated one might > be faster because of better memory alignment. > > And if you're talking about the extra indirection added by > boost::scoped_array... I admit I haven't measured, but I > doubt very, very > much you would notice any difference unless all your program > did was run in a > for loop accessing array elements. > > > The best fix in our situation will be to use defines as far > as i can > > see. > > Personally, I see nothing wrong with simple defines for > things like that. It's > when you start doing complicated macros that the > pre-processor can become > more of a problem than it solves. > > > --Noel > Games from Within > http://www.gamesfromwithin.com > > > > ------------------------------------------------------- > This SF.Net email sponsored by Black Hat Briefings & > Training. Attend Black Hat Briefings & Training, Las Vegas > July 24-29 - > digital self defense, top technical experts, no vendor pitches, > unmatched networking opportunities. Visit www.blackhat.com > _______________________________________________ > Gamedevlists-general mailing list > Gam...@li... > https://lists.sourceforge.net/lists/listinfo/gamedevlists-general > Archives: http://sourceforge.net/mailarchive/forum.php?forum_id=557 > > --- > Incoming mail is certified Virus Free. > Checked by AVG anti-virus system (http://www.grisoft.com). > Version: 6.0.716 / Virus Database: 472 - Release Date: 05/07/2004 > > --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.716 / Virus Database: 472 - Release Date: 05/07/2004 |