Monday, February 15, 2016

Day 37: Leaky Memory

Yeragh! So much has been put into this Scope assignment! Thankfully I learned a couple of things:

Scopes keep track of their own heap allocated memory; when making a scope within a scope, one must never do static allocation, as that is automatically destroyed when going out of scope.

Adopt methods don't have an index! Whoohoo!

Remove and Find methods (templated, overloaded, or otherwise) are actually kind of a necessary thing in the case of working with Scopes. Had to implement them as a result in the previous Datum.

Memory leaks! Yeesh. Turns out when doing a deep copy, I had to be careful to heap-allocate new scopes but only when necessary (keeping the rest of the Datum objects intact). Those CRT libraries don't really do too much, even with mapping the allocations to their files.

What next? More scopes, more testing! I have a couple of questions regarding appending scopes and such that need to be answered...

No comments:

Post a Comment