MCPcopy Create free account
hub / github.com/RenderKit/embree / alloc

Method alloc

kernels/common/buffer.h:21–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19 {
20 private:
21 char* alloc(void* ptr_in, bool &shared, EmbreeMemoryType memoryType)
22 {
23 if (ptr_in)
24 {
25 shared = true;
26 return (char*)ptr_in;
27 }
28 else
29 {
30 shared = false;
31 device->memoryMonitor(this->bytes(), false);
32 size_t b = (this->bytes()+15) & ssize_t(-16);
33 return (char*)device->malloc(b,16,memoryType);
34 }
35 }
36
37 public:
38 Buffer(Device* device, size_t numBytes_in, void* ptr_in)

Callers 1

mallocFunction · 0.45

Calls 3

bytesMethod · 0.95
memoryMonitorMethod · 0.45
mallocMethod · 0.45

Tested by

no test coverage detected