Closed GordonSmith closed 6 months ago
I'm afraid I don't follow: realloc()
is generally specified to preserve the original contents of the incoming buffer. realloc()
can of course return a different pointer than is passed as parameter (in which case the impl will have to copy over the original contents over to the returned buffer), but all 5 locations you linked to anticipate this by updating ptr
with the return value of cx.opts.realloc()
, so I don't see the problem.
This is not true for c++ guests (although it can be a common optimization in some clibs - but less likely on embedded systems etc.)