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.


Don't forget to read Tuesday's email newsletter for your chance to win a free copy of Construct 2!


#ActualEWClay

Posted 20 February 2013 - 07:00 AM

Problems that I can see:

Access to states would be quite slow; you have to look up the store every time.

All the constructors are called up front, and destructors are never called until the store is shut down.

Once allocated, memory can only be reused for the same type as the original allocation.

No way to break circular references.

I don't believe this can be made thread safe.

Edit: actually it's worse than a lack of thread safety. Get a reference to an object. Call a method. It creates a new object of the same type. The original object moves in memory due to the vector emplace_back. Heap corruption and massive bug hunt follows.

#1EWClay

Posted 20 February 2013 - 06:30 AM

Problems that I can see:

Access to states would be quite slow; you have to look up the store every time.

All the constructors are called up front, and destructors are never called until the store is shut down.

Once allocated, memory can only be reused for the same type as the original allocation.

No way to break circular references.

I don't believe this can be made thread safe.

PARTNERS