[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]
void *qRealloc(void *ptr, size_t size) { void* newPtr = Eigen::internal::aligned_malloc(size); memcpy(newPtr, ptr, size); Eigen::internal::aligned_free(ptr); return newPtr; }
My question is: Why can you do the memcpy in that way? If size is larger than the the block pointed to by ptr, memcpy will possibly access invalid memory locations, won't it?
Best regards, Michael