0

It appears to me both allocate a block of memory and return the pointer to the first byte. Any difference? I notice that GCC's allocator classes have two versions, one using ::operator new, another one using malloc.

http://gcc.gnu.org/viewcvs/gcc/trunk/libstdc%2B%2B-v3/include/ext/new_allocator.h?view=markup

http://gcc.gnu.org/viewcvs/gcc/trunk/libstdc%2B%2B-v3/include/ext/malloc_allocator.h?view=markup

(I understand that new expression and operator new are different)

szli
  • 36,893
  • 11
  • 32
  • 40

0 Answers0