ctx is not owned by this function.
| 50 | |
| 51 | // ctx is not owned by this function. |
| 52 | void Compute(OpKernelContext* ctx) override { |
| 53 | mutex_lock l(mu_); |
| 54 | |
| 55 | if (!table_handle_set_) { |
| 56 | OP_REQUIRES_OK(ctx, cinfo_.Init(ctx->resource_manager(), def(), |
| 57 | use_node_name_sharing_)); |
| 58 | } |
| 59 | |
| 60 | auto creator = |
| 61 | [ctx, this](lookup::LookupInterface** ret) |
| 62 | EXCLUSIVE_LOCKS_REQUIRED(mu_) { |
| 63 | lookup::LookupInterface* container = new Container(ctx, this); |
| 64 | if (!ctx->status().ok()) { |
| 65 | container->Unref(); |
| 66 | return ctx->status(); |
| 67 | } |
| 68 | if (ctx->track_allocations()) { |
| 69 | ctx->record_persistent_memory_allocation( |
| 70 | container->MemoryUsed() + table_handle_.AllocatedBytes()); |
| 71 | } |
| 72 | *ret = container; |
| 73 | return Status::OK(); |
| 74 | }; |
| 75 | |
| 76 | lookup::LookupInterface* table = nullptr; |
| 77 | OP_REQUIRES_OK(ctx, |
nothing calls this directly
no test coverage detected