alloc, malloc, and alloca — What's the difference?

前端 未结 3 821
逝去的感伤
逝去的感伤 2021-01-31 04:07

I was under the impression that alloc in Objective-C (when we invoke [anyObject alloc] is actually implementing C function malloc and the

3条回答
  •  不思量自难忘°
    2021-01-31 04:32

    The alloc function is used to allocate a region or block of size bytes in length of the heap.

    The malloc function is used to allocate heap storage. Its name stands for memory allocation.

提交回复
热议问题