|
Navigation
Recherche
|
Closures as Win32 window procedures
mardi 16 décembre 2025, 16:27 , par OS News
Back in 2017 I wrote about a technique for creating closures in C using JIT-compiled wrapper. It’s neat, though rarely necessary in real programs, so I don’t think about it often. I applied it to qsort, which sadly accepts no context pointer. More practical would be working around insufficient custom allocator interfaces, to create allocation functions at run-time bound to a particular allocation region. I’ve learned a lot since I last wrote about this subject, and a recent article had me thinking about it again, and how I could do better than before. In this article I will enhance Win32 window procedure callbacks with a fifth argument, allowing us to more directly pass extra context. I’m using w64devkit on x64, but the everything here should work out-of-the-box with any x64 toolchain that speaks GNU assembly.
↫ Chris Wellons Sometimes, people get upset when I mention something is out of my wheelhouse, so just for those people, here’s an article well outside of my wheelhouse. I choose honesty over faking confidence.
https://www.osnews.com/story/144025/closures-as-win32-window-procedures/
Voir aussi |
56 sources (32 en français)
Date Actuelle
mer. 17 déc. - 14:57 CET
|








