Dynamic memory allocation, usually in the context of languages without garbage collection or mandatory or automatic reference counting, refers to the process or asking the operating system for a variable sized block of memory.
I'm aware you can use MemoryLayout<T>.size to get the size of a type T. For example: …
swift heap-memory dynamic-allocation memory-layout