在 2022-04-09 22:23, Thomas Faber 写道:
I think this only makes a difference in terms of how constructors/destructors are called,
so
shouldn't matter for an array of chars.
I'm not sure whether there's any particular advantage here to calling the
operator directly rather
than the more obvious new[]. So it could make sense to change it.
Thanks for the feedback.
It's just that `delete[]`'d memory should have been allocated by `new[]`, and
`free()`'d memory
should have been alllocated by `{m,c,re}alloc()` etc. It may work by accident, but is
nevertheless
undefined behavior.
It is still uncertain that whether we should incorporate this piece of C++ code into
mingw-w64
headers as inline functions, or as a separate library. Anyway your work shall be
appreciated.
--
Best regards,
LIU Hao