3 ms·
If you want to allow people to build curl using various different compilers (and old versions of them) on Windows, it needs to support all their libc’s. And at
by mrpippy 4y ago
If you want to allow people to build curl using various different compilers (and old versions of them) on Windows, it needs to support all their libc’s.
And at runtime, libcurl could find itself using a different libc from the application, so a buffer malloc’d in libc can’t be passed to free() by the app.
- Joker_vD 4y ago> And at runtime, libcurl could find itself using a different libc from the application, so a buffer malloc’d in libc can’t be passed to free() by the app. Yes, it's something anybody who has been seriously programming for Windows has been aware since forever. Which is why libraries and plugins generally expose FreeX() for every X they allocate and return.
- pjc50 4y ago> If you want to allow people to build curl using various different compilers (and old versions of them) on Windows, it needs to support all their libc’s. That sounds like a problem that could be solved by not doing that and picking one.
- spacechild1 4y ago> And at runtime, libcurl could find itself using a different libc from the application, so a buffer malloc’d in libc can’t be passed to free() by the app. That's a general issue with C plugins/libraries. You cannot even assume that objects are allocated with malloc() because the library might use its own memory allocator, object pool, etc.