MCPcopy Create free account
hub / github.com/IntegralPilot/wasm_os / allocate

Method allocate

stdlib/cpp/vector.hpp:288–297  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

286
287private:
288 static T* allocate(size_type n) {
289 if (n > 0) {
290 void* raw_ptr = ::malloc(n * sizeof(T));
291 if (!raw_ptr) {
292 for(;;);
293 }
294 return static_cast<T*>(raw_ptr);
295 }
296 return nullptr;
297 }
298
299 static void deallocate(T* ptr) noexcept {
300 ::free(ptr);

Callers

nothing calls this directly

Calls 1

mallocFunction · 0.85

Tested by

no test coverage detected