func allocate()

in Source/AwsCommonRuntimeKit/crt/Allocator.swift [19:24]


    func allocate<T>() throws -> UnsafeMutablePointer<T> {
        guard let result = aws_mem_acquire(self.rawValue, MemoryLayout<T>.size) else {
            throw CRTError.memoryAllocationFailure
        }
        return result.bindMemory(to: T.self, capacity: 1)
    }