Conversation
|
Thanks for this! I'm pretty ignorant of the Windows side of the fence. Does it make more sense to check for the include file and check for existance of the VirtualAlloc() method as opposed to just testing for WIN32? |
|
I can't say no with 100% confidence. People have been discussing configure tests for WinAPI in the past, but most projects seem to rely on preprocessor symbols pre-defined by the compiler (e.g. SQLite tests for On the other hand, the ancient documentation says this function is to be found in Judging by old StackOverflow questions, older Windows SDKs may indeed lack I'll search the documentation some more and implement a configure test choosing between |
|
Thanks. I appreciate the work. Yeah I'd rather test for existence of the function and the includes as opposed to a compiler symbol. |
Since the Microsoft documentation is not 100% clear on this, check for VirtualAlloc() and VirtualFree() in either <windows.h> or <windows.h> + <memoryapi.h>, even though the documentation may have meant "use either header file". Do not regenerate ./configure yet.
Pass both dmalloc_fc_t and dmalloc_t tests.
b29b316 to
4e25a14
Compare
|
Here are the configure tests. I made |
|
@j256 VirtualAlloc is deeply ingrained into Windows. I'd say checking _WIN32 is more than enough. At least MSVC and gcc as well as clang set that predefined macro. It is just a waste of time to double-check with configure. |
Hello again,
Here's the pull request I've been meaning to submit back in 2020. This makes use of
VirtualAlloconWIN32to allocate memory dynamically instead of relying onINTERNAL_MEMORY_SPACE. After./configure --host=x86_64-w64-mingw32I can rename and manually run thedmalloc_fc_tanddmalloc_texecutables with the arguments specified for thelightandheavyMakefile targets; the tests pass.