| 129 | } |
| 130 | |
| 131 | TfLiteStatus SimpleMemoryArena::ResolveAlloc(TfLiteContext* context, |
| 132 | const ArenaAlloc& alloc, |
| 133 | char** output_ptr) { |
| 134 | TF_LITE_ENSURE(context, committed_); |
| 135 | TF_LITE_ENSURE(context, output_ptr != nullptr); |
| 136 | if (alloc.size == 0) { |
| 137 | *output_ptr = nullptr; |
| 138 | } else { |
| 139 | *output_ptr = underlying_buffer_aligned_ptr_ + alloc.offset; |
| 140 | } |
| 141 | return kTfLiteOk; |
| 142 | } |
| 143 | |
| 144 | TfLiteStatus SimpleMemoryArena::Clear() { |
| 145 | committed_ = false; |
no outgoing calls