MCPcopy Create free account
hub / github.com/apache/madlib / allocate

Method allocate

src/utils/MallocAllocator.hpp:60–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58 }
59
60 pointer allocate(size_type n,
61 MallocAllocator<void>::const_pointer /* hint */ = 0) {
62
63 if (n > this->max_size())
64 throw std::bad_alloc();
65 pointer ptr = static_cast<pointer>(std::malloc(n * sizeof(T)));
66 if (!ptr)
67 throw std::bad_alloc();
68 return ptr;
69 }
70
71 void deallocate(pointer p, size_type /* n */) {
72 std::free(static_cast<void*>(p));

Callers

nothing calls this directly

Calls 1

max_sizeMethod · 0.95

Tested by

no test coverage detected