`malloc` vs. C++ `new`: Key Differences in `nogil` Contexts
While both allocate memory, `malloc` (C-style) only reserves raw memory, returning a `void*`, whereas C++'s `new` calls constructors for objects, returns a typed pointer, and is generally preferred for C++ types.