>From what I see and also summarize the discussion:

- No new/delete, but allows use of custom allocators that does arena-like 
allocations.
- C++ is fine, template is fine, but maybe no stl

The arena-style allocator may be fine for most of our cases, the idea is that 
we always allocate and de-allocate in a bulk. This allows us to keep most of 
the allocation in a single user defined stack on a memory region.

```c++
void MyApp() {
  // RAII, everything allocated within the function will only get the space, 
   // de-allocate the necessary space when MyApp 
   tvm::micro::AllocatorContext ctx;
}
```

 A slight variation would be having the allocator remember the number of object 
it allocates so far in the current context, when we call free, it only 
decreases the counter, and we recycle everything when the counter goes to zero. 
This should work for most cases we care about(where the allocation/free pattern 
are like a stack).

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/dmlc/tvm/pull/3567#issuecomment-513006732

Reply via email to