Allocates uninitialized memory for the specified number of instances of type
- Xcode 9.3+
- Swift Standard Library
The amount of memory to allocate, counted in instances of
The resulting buffer references a region of memory that is bound to
Element and is
count * Memory bytes in size.
The following example allocates a buffer that can store four
Int instances and then initializes that memory with the elements of a range:
When you allocate memory, always remember to deallocate once you’re finished.