News for hackers. Stuff that matters.
Re:The Windows malloc() implementation from MSVCRT is slow by garaetjjte on Saturday July 02, 2022 @05:35PM (#31962672)
>but Microsoft never considered the MSVCRT that ships with Windows to be public API

It was in the past. At first msvcrt.dll was the runtime library used up to Visual C++ 6. Later, VC++ moved to their own separate dlls, but you could still link with system msvcrt.dll using corresponding DDK/WDK up to Windows 7.

I'm also not sure that this is just ancient library left for compatibility, some system components still link to it, and msvcrt.dll itself seems to link with UCRT libraries.

Re:The Windows malloc() implementation from MSVCRT is slow by TonyTrapp on Saturday July 02, 2022 @05:40PM (#31962719)
> It was in the past. At first msvcrt.dll was the runtime library used up to Visual C++ 6.

At that time it was already a big mess, because at first it was the runtime library of Visual C++ 4 in fact! The gory details are here: https://devblogs.microsoft.com/oldnewthing/20140411-00/?p=12...

> some system components still link to it

Some system components themselves are very much ancient and unmaintained and only exist for backwards compatibility as well.

Re:The Windows malloc() implementation from MSVCRT is slow by garaetjjte on Saturday July 02, 2022 @06:37PM (#31963105)
Ancient or not, I don't think it really matters for allocation performance: malloc in both msvcrt.dll and ucrtbase.dll after some indirection ends up calling RtlAllocateHeap in ntdll.dll
Re:The Windows malloc() implementation from MSVCRT is slow by TonyTrapp on Sunday July 03, 2022 @06:31AM (#31966620)
It does, because modern allocators do a lot of house keeping on top of the system heaps, e.g. to quickly reuse identically-sized memory chunks that were just freed.
Re:The Windows malloc() implementation from MSVCRT is slow by jasomill on Sunday July 03, 2022 @02:04AM (#31965468)
For posterity, here's a link to a version of that page with the original comments section intact:

https://web.archive.org/web/20160410051513/https://blogs.msd...

Re:The Windows malloc() implementation from MSVCRT is slow by ComputerGuru on Saturday July 02, 2022 @07:52PM (#31963626)
I don’t think msvcrt is exposed to link against in the DDK anymore. I maintain this, with the caveat that you really need to know what you’re doing: https://github.com/neosmart/msvcrt.lib