Jinoh Kang (@iamahuman) commented about dlls/ntdll/heap.c:
-static size_t get_free_list_block_size( unsigned int index ) +/* + * Given a size, return its index in the block size list for freelists. + * + * With FREE_LIST_LINEAR_BITS=3, the list looks like this + * (with respect to size / BLOCK_ALIGN): + * 0, + * 1, 2, 3, 4, 5, 6, 7, 8, + * 9, 10, 11, 12, 13, 14, 15, 16, + * 18, 20, 22, 24, 26, 28, 30, 32, + * 36, 40, 44, 48, 52, 56, 60, 64, + * 72, 80, 88, 96, 104, 112, 120, 128, + * ... + */ +static unsigned long get_free_list_block( size_t size )
Wine tries to avoid `unsigned long`. `long` differs in width between the LP64 model (64-bit Unix side, where `long` is 64-bit) and the LLP64 model (64-bit PE code, where `long` is 32-bit), which makes it confusing[^aj-ulong] and incompatible with `-mno-cygwin` builds. ```suggestion:-0+0 static unsigned int get_free_list_block( size_t size ) ``` On the other hand, `ULONG` is guaranteed to mean unsigned 32-bit integer and thus fine to use: ```suggestion:-0+0 static ULONG get_free_list_block( size_t size ) ``` Ditto for other `unsigned long` uses. [^aj-ulong]: See <https://www.winehq.org/mailman3/hyperkitty/list/wine-devel(a)winehq.org/message/N6NC2HPTJKFPKQHZMCKT6QZ3XIXYS22C/>. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/2622#note_29457