Differences From Artifact [960649af1d]:
- File
src/OFSecureData.m
— part of check-in
[627511b032]
at
2020-11-14 12:23:55
on branch trunk
— Rename of_malloc and of_calloc
The new names should be more accurate. (user: js, size: 14715) [annotate] [blame] [check-ins using] [more...]
To Artifact [7de8ab3a25]:
- File src/OFSecureData.m — part of check-in [b46492384a] at 2020-11-29 00:59:23 on branch trunk — of_bitset_*: Use CHAR_BIT instead of 8 (user: js, size: 14753) [annotate] [blame] [check-ins using] [more...]
︙ | ︙ | |||
97 98 99 100 101 102 103 | munmap(pointer, numPages * pageSize); } static struct page * addPage(bool allowPreallocated) { size_t pageSize = [OFSystemInfo pageSize]; | | > | 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 | munmap(pointer, numPages * pageSize); } static struct page * addPage(bool allowPreallocated) { size_t pageSize = [OFSystemInfo pageSize]; size_t mapSize = OF_ROUND_UP_POW2(CHAR_BIT, pageSize / CHUNK_SIZE) / CHAR_BIT; struct page *page; # if !defined(OF_HAVE_COMPILER_TLS) && defined(OF_HAVE_THREADS) struct page *lastPage; # endif if (allowPreallocated) { # if !defined(OF_HAVE_COMPILER_TLS) && defined(OF_HAVE_THREADS) |
︙ | ︙ | |||
182 183 184 185 186 187 188 | } static void removePageIfEmpty(struct page *page) { unsigned char *map = page->map; size_t pageSize = [OFSystemInfo pageSize]; | | > | 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 | } static void removePageIfEmpty(struct page *page) { unsigned char *map = page->map; size_t pageSize = [OFSystemInfo pageSize]; size_t mapSize = OF_ROUND_UP_POW2(CHAR_BIT, pageSize / CHUNK_SIZE) / CHAR_BIT; for (size_t i = 0; i < mapSize; i++) if (map[i] != 0) return; unmapPages(page->page, 1); free(page->map); |
︙ | ︙ |