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

Method allocate

kernels/common/vector.h:28–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26 : device(device), hugepages(false) {}
27
28 __forceinline pointer allocate( size_type n )
29 {
30 if (n) {
31 assert(device);
32 device->memoryMonitor(n*sizeof(T),false);
33 }
34 if (n*sizeof(value_type) >= 14 * PAGE_SIZE_2M)
35 {
36 pointer p = (pointer) os_malloc(n*sizeof(value_type),hugepages);
37 assert(p);
38 return p;
39 }
40 return (pointer) alignedMalloc(n*sizeof(value_type),alignment);
41 }
42
43 __forceinline void deallocate( pointer p, size_type n )
44 {

Callers

nothing calls this directly

Calls 3

os_mallocFunction · 0.85
alignedMallocFunction · 0.85
memoryMonitorMethod · 0.45

Tested by

no test coverage detected