Created on 2013-09-28.00:00:00 last changed 121 months ago
Notes from the September, 2013 meeting:
EWG was not so concerned with memory leaks, but there are problems with the current wording dealing with lifetime issues. In particular, the existing wording did not guarantee that all of the merged allocations would, in fact, be executed. The intended direction is to relax the strict lifetime containment requirement from the current wording but to ensure that all of the allocations and frees will be executed, which requires that the allocation and initialization of later objects be non-throwing.
[Applied to WP at the February, 2014 meeting as part of document N3914.]
The strategy of merging allocations could turn a small memory leak into a big one. For example,
class P { int x; }; class Q { public: Q(){ throw 42; } private: int x[LARGE_NUMBER]; }; { P* p1 = new P(); Q* q1 = new Q(); // bang :-( // don't get here delete q1; delete p1; }
Instead of just leaking the first allocation, this could result in leaking the combined allocation.
History | |||
---|---|---|---|
Date | User | Action | Args |
2014-11-24 00:00:00 | admin | set | status: dr -> c++14 |
2014-03-03 00:00:00 | admin | set | status: drafting -> dr |
2013-10-14 00:00:00 | admin | set | messages: + msg4623 |
2013-09-28 00:00:00 | admin | create |