more commonly I was just using my own set of containers that operated on objects that didn't need to have destructors called, and can be memcpy'd. c++20 concepts make it impossible for me to accidentally put an incompatible type into one of those, so there's that as well
-
-
yeah I remember adding an allocator into the one system I had that had a ton of creation+destruction of objects (animation) years ago, noticing no difference in performance, and just going back to malloc again...
-
but the issue was most of those objects had other objects that were using malloc inside their constructor/destructor (vectors and strings and some other stuff) so I was hitting it a bunch anyway
- Show replies
New conversation -
-
-
The computer doesn't necessarily do things one-by-one, though. For example, a chess solver could have a chessboard, which has two vectors of pieces, one for team 1, one for team 2. Each piece could be POD with a type ID (ex: 1 for pawn) and a coordinate.
-
Conceptually, what's destroyed? Up to 16 pieces, two vectors, and a chessboard. What's actually done? Two frees and a stack frame pop.
- Show replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.