func allocate()

in Source/AwsCommonRuntimeKit/crt/Allocator.swift [35:40]


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