eygilbert / egdb_intl

Functions to access the kingsrow international draughts endgame database
Boost Software License 1.0
4 stars 3 forks source link

TODO list for porting from Windows to Linux #1

Closed rhalbersma closed 8 years ago

rhalbersma commented 8 years ago

Below a list of all Windows specific system calls. In parenthesis the likely replacement in terms of Standard C++ or Linux specific system calls. A checked box means that the replacement has been tested. Memory and File I/O can be tested on Windows under Visual Studio. The rest on Windows under MinGW or on Linux under g++.

Memory

File I/O

Bit twiddling

Threading

System information

eygilbert commented 8 years ago

I think I can eliminate a few of these issues. The 3 CriticalSection functions are #if'd out and not used. We don't need to port them. get_page_size() is only needed for Windows because of FILE_FLAG_NO_BUFFERING. For Linux it can return 4096.

eygilbert commented 8 years ago

I'm not sure about AllocationGranularity. If it is trying to mimic the behavior of VirtualAlloc then the granularity can be set to 4096.

eygilbert commented 8 years ago

Added solutions to the table for _InterlockedExchange,__cpuid, SYSTEM_INFO.dwPageSize, and MEMORYSTATUS.dwAvailPhys

rhalbersma commented 8 years ago

I have pushed a commit that implements this using std::atomic_flag from <atomic>.