| 225 | |
| 226 | public: |
| 227 | BorrowedLocalHeap GetLH() |
| 228 | { |
| 229 | std::lock_guard lock(m); |
| 230 | if (heaps.Size()) |
| 231 | { |
| 232 | auto tmp = heaps.Last(); |
| 233 | heaps.SetSize(heaps.Size()-1); |
| 234 | // cout << "reuse existing lh" << endl; |
| 235 | return BorrowedLocalHeap (tmp, this); |
| 236 | } |
| 237 | |
| 238 | // cout << "create new lh" << endl; |
| 239 | return BorrowedLocalHeap(new LocalHeap(global_heapsize, "python-comp lh", true), this); |
| 240 | } |
| 241 | |
| 242 | void ReturnLH (LocalHeap * lh) |
| 243 | { |
no test coverage detected