Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


#ActualWaterlimon

Posted 24 December 2012 - 10:51 AM

By allocating on the stack i meant for example passing the size as a template variable like i do now, but id like to do that without template variables.<br /><br />But now that i think about it, it wouldnt be possible, since if it were i could have 2 objects of the same type but with a different size.<br /><br />Ill just create different classes for heap and stack allocated arrays (grids in my case)

I know that the stack as memory isnt any faster, but if i were to have a small array as a part of a object that is initialized a lot, it would probably be more efficient to have it be a part of the object instead of each object pointing to a random location in RAM.

#1Waterlimon

Posted 24 December 2012 - 10:49 AM

By allocating on the stack i meant for example passing the size as a template variable like i do now, but id like to do that without template variables.<br /><br />But now that i think about it, it wouldnt be possible, since if it were i could have 2 objects of the same type but with a different size.<br /><br />Ill just create different classes for heap and stack allocated arrays (grids in my case)

PARTNERS