Login | Register   
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


advertisement
 

Allocating Arrays with Placement new

Learn how to allocate arrays of objects on a predetermined memory address using this unusual twist on placement new.


advertisement
llocating objects on a predetermined memory address has become a popular idiom in recent years, particularly in mobile programming, embedded systems, and custom garbage collectors. However, the technique shown in my debut 10-Minute Solution covers only scalar objects. Many readers have asked me whether it's possible to use a similar technique for allocating arrays as well. The answer is of course "yes." Here's how.


How can you allocate arrays of objects on a predetermined memory address?


Use placement new with a twist.



Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap