Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


#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