Reference:
How to implement a malloc:http://blog.jobbole.com/75656/elaborate on the 10 differences between New and malloc: http://www.linuxidc.com/Linux/2016-01/127591.htm
The prototype of malloc in C Libarariy: http://www.cplusplus.com/reference/cstdlib/malloc/
C Dynamic memory Management
void *malloc (size_t size), which requests a size bytes (bytes) of memory to the system, successfully returns a void* pointer (because the requested memory area is untyped, uninitialized), points to the first address, fails to return a null pointer, The size=0 return value depends on the library implementation. Using the requested memory to construct the object requires the void* pointer to be cast as a corresponding pointer, such as CHAR*P = (char *) malloc (100)) (100 bytes), and how many char does this 100 byte create? A char *p= (char*) malloc (100*sizeof (char)) can be used to request 100 char memory.
C + + memory management