Changeset 6711


Ignore:
Timestamp:
Sep 5, 2008, 2:32:32 PM (12 years ago)
Author:
muks
Message:

(win32) Add getpagesize() and getregionsize() implementations

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/platform.c

    r6710 r6711  
    660660    InterlockedExchange (sl, 0);
    661661    return 0;
     662}
     663
     664/* getpagesize for windows */
     665static long getpagesize (void) {
     666    static long g_pagesize = 0;
     667    if (! g_pagesize) {
     668        SYSTEM_INFO system_info;
     669        GetSystemInfo (&system_info);
     670        g_pagesize = system_info.dwPageSize;
     671    }
     672    return g_pagesize;
     673}
     674
     675static long getregionsize (void) {
     676    static long g_regionsize = 0;
     677    if (! g_regionsize) {
     678        SYSTEM_INFO system_info;
     679        GetSystemInfo (&system_info);
     680        g_regionsize = system_info.dwAllocationGranularity;
     681    }
     682    return g_regionsize;
    662683}
    663684
Note: See TracChangeset for help on using the changeset viewer.