diff options
| author | Yong He <yonghe@outlook.com> | 2018-02-19 13:00:51 -0500 |
|---|---|---|
| committer | Yong He <yonghe@outlook.com> | 2018-02-19 15:26:26 -0500 |
| commit | ff8adf7b45121aada0b4f4403b0f45a6e2dfe475 (patch) | |
| tree | a7441d66e41d99c969651bebe048cf1f78fee95f /source/core/smart-pointer.h | |
| parent | 51cdcad24b5271ac8c0f816174c6a760e264ed9e (diff) | |
Fix IR memory leaks.
1, make IRModule class own a memory pool for all IR object allocations
2. For now, we allow IR objects to own other (externally) heap allocated objects, such as String, List and RefPtrs by tracking all IR objects that has been allocated for the IRModule in a list named `IRModule::irObjectsToFree`. and call destructor for all these objects upon the destruction of the IRModule. In the long term, we should eliminate the use of all these externally allocated types in IR system and get rid of this tracking and explicit destructor calls.
3. remove non-generic `createValueImpl` functions and retain only generic versions in IRBulider so we can properly call the constructor of the IR types to set up virtual tables correctly for destructor dispatching.
4. add `MemoryPool` class for allocation of the IR objects.
5. Make sure we are disposing IRSpecContexts when we are done with the specialized IR module.
6. Add `_CrtDumpMemoryLeaks()` calls to check memory leaks upon destruction of a Slang session. If we are to support multiple sessions at a time, this call should probably be replaced with the more advanced MemoryState versions of the memory leak checker.
Diffstat (limited to 'source/core/smart-pointer.h')
0 files changed, 0 insertions, 0 deletions
