| 284 | /* ===================== DevMemAllocImpl ===================== */ |
| 285 | |
| 286 | StreamMemAlloc* DevMemAllocImpl::add_stream(StreamKey stream) { |
| 287 | MGB_LOCK_GUARD(m_mutex); |
| 288 | auto&& ptr = m_stream_alloc[stream]; |
| 289 | if (!ptr) |
| 290 | ptr.reset(new StreamMemAllocImpl(this, m_stream_alloc.size() - 1)); |
| 291 | return ptr.get(); |
| 292 | } |
| 293 | |
| 294 | MemAllocImplHelper::MemAddr DevMemAllocImpl::alloc(size_t size) { |
| 295 | auto addr = do_alloc(size, true); |