Aspects


vs


Malloc

The malloc function performs dynamic memory allocation in C and is part of the standard library

Memcpy

Memcpy() is a C standard library function used for copying a block of memory bytes from one place to another.

Others

Quality Example
Slower

"Afaik malloc is not slower than memcpy"

from question "Is cudamalloc slower than cudamemcpy?"

Less call

"This allows you to use the assignment operator instead of memcpy and requires 1 less call to malloc - the one you make"

from question "Why is memory still accessible after std::map::clear() is called?"

Back to Home
Data comes from Stack Exchange with CC-BY-SA-3.0