Fossil

Check-in [fd1bee72]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:POSIX enhancements for fossil_get_page_size().
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | withMman
Files: files | file ages | folders
SHA3-256: fd1bee7279b959c847abb37d55267c0013df18c0d841f9d112b1938251a0e3f6
User & Date: mistachkin 2018-03-17 21:16:54.498
Context
2018-03-17
21:24
Report the detected memory page size in the verbose version information. ... (check-in: a6a2d861 user: mistachkin tags: withMman)
21:16
POSIX enhancements for fossil_get_page_size(). ... (check-in: fd1bee72 user: mistachkin tags: withMman)
20:53
Merge updates from trunk. ... (check-in: 2c3b7457 user: mistachkin tags: withMman)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/util.c.
17
18
19
20
21
22
23

24
25
26
27
28
29
30
**
** This file contains code for miscellaneous utility routines.
*/
#include "config.h"
#include "util.h"
#if defined(USE_MMAN_H)
# include <sys/mman.h>

#endif

/*
** For the fossil_timer_xxx() family of functions...
*/
#ifdef _WIN32
# include <windows.h>







>







17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
**
** This file contains code for miscellaneous utility routines.
*/
#include "config.h"
#include "util.h"
#if defined(USE_MMAN_H)
# include <sys/mman.h>
# include <unistd.h>
#endif

/*
** For the fossil_timer_xxx() family of functions...
*/
#ifdef _WIN32
# include <windows.h>
73
74
75
76
77
78
79


80
81
82
83
84
85
86
}
void fossil_get_page_size(size_t *piPageSize){
#if defined(_WIN32)
  SYSTEM_INFO sysInfo;
  memset(&sysInfo, 0, sizeof(SYSTEM_INFO));
  GetSystemInfo(&sysInfo);
  *piPageSize = (size_t)sysInfo.dwPageSize;


#else
  *piPageSize = 4096; /* FIXME: What for POSIX? */
#endif
}
void *fossil_secure_alloc_page(size_t *pN){
  void *p;
  size_t pageSize;







>
>







74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
}
void fossil_get_page_size(size_t *piPageSize){
#if defined(_WIN32)
  SYSTEM_INFO sysInfo;
  memset(&sysInfo, 0, sizeof(SYSTEM_INFO));
  GetSystemInfo(&sysInfo);
  *piPageSize = (size_t)sysInfo.dwPageSize;
#elif defined(USE_MMAN_H)
  *piPageSize = (size_t)sysconf(_SC_PAGE_SIZE);
#else
  *piPageSize = 4096; /* FIXME: What for POSIX? */
#endif
}
void *fossil_secure_alloc_page(size_t *pN){
  void *p;
  size_t pageSize;