[ros-general] How can I copy code from ReactOS to mingw-w64?
LIU Hao
lh_mouse at 126.com
Sat Apr 9 16:05:56 UTC 2022
在 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 840 bytes
Desc: OpenPGP digital signature
URL: <http://reactos.org/pipermail/ros-general/attachments/20220410/aa933e37/attachment.sig>
More information about the Ros-general
mailing list