Fossil

Check-in [e6a5634f]
Login

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

Overview
Comment:Add an assert().
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | seeEnhanced
Files: files | file ages | folders
SHA1:e6a5634f24d86f16bad462ad7af25f6a6cf6271b
User & Date: mistachkin 2016-10-04 19:05:05
Context
2016-10-04
19:07
Merge updates from trunk. check-in: 04a8ee6e user: mistachkin tags: seeEnhanced
19:05
Add an assert(). check-in: e6a5634f user: mistachkin tags: seeEnhanced
2016-09-23
02:28
Merge updates from trunk. check-in: 4f619c02 user: mistachkin tags: seeEnhanced
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/util.c.

80
81
82
83
84
85
86

87
88
89
90
91
92
93
}
void *fossil_secure_alloc_page(size_t *pN){
  void *p;
  size_t pageSize;

  fossil_get_page_size(&pageSize);
  assert( pageSize>0 );

#if defined(_WIN32)
  p = VirtualAlloc(NULL, pageSize, MEM_COMMIT|MEM_RESERVE, PAGE_READWRITE);
  if( p==NULL ){
    fossil_fatal("VirtualAlloc failed: %lu\n", GetLastError());
  }
  if( !VirtualLock(p, pageSize) ){
    fossil_fatal("VirtualLock failed: %lu\n", GetLastError());







>







80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
}
void *fossil_secure_alloc_page(size_t *pN){
  void *p;
  size_t pageSize;

  fossil_get_page_size(&pageSize);
  assert( pageSize>0 );
  assert( pageSize%2==0 );
#if defined(_WIN32)
  p = VirtualAlloc(NULL, pageSize, MEM_COMMIT|MEM_RESERVE, PAGE_READWRITE);
  if( p==NULL ){
    fossil_fatal("VirtualAlloc failed: %lu\n", GetLastError());
  }
  if( !VirtualLock(p, pageSize) ){
    fossil_fatal("VirtualLock failed: %lu\n", GetLastError());