MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / SetHeader

Function SetHeader

tensorflow/core/common_runtime/tensorpool_allocator.cc:69–82  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

67}
68
69void* SetHeader(void* p, size_t total_bytes, size_t header_size,
70 void* bin, void* internal_bin) {
71 // Header *KB max(sizeof(Header)=64B, alignment)
72 // { |........| begin_time 16B | end_time 16B | total_size 8B
73 // | user_size 8B | raw_ptr 8B | user_ptr 8B }
74 auto h = new((char*)p + header_size - sizeof(Header))Header();
75 h->user_size = total_bytes - header_size;
76 h->user_ptr = (char*)p + header_size;
77 h->raw_ptr = p;
78 h->total_size = total_bytes;
79 h->bin = bin;
80 h->internal_bin = internal_bin;
81 return h->user_ptr;
82}
83
84class DefaultCPUSubAllocator : public SubAllocator {
85 public:

Callers 1

AllocateMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected