Differences From Artifact [8a522b1fcf]:
- File src/OFSecureData.m — part of check-in [9d74d1b74e] at 2020-11-06 02:12:39 on branch trunk — OFData: Make parameter order more consistent (user: js, size: 14705) [annotate] [blame] [check-ins using] [more...]
To 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...]
︙ | ︙ | |||
136 137 138 139 140 141 142 | # endif } return page; } } | | | | 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 | # endif } return page; } } page = of_alloc(1, sizeof(*page)); @try { page->map = of_alloc_zeroed(1, mapSize); } @catch (id e) { free(page); @throw e; } @try { page->page = mapPages(1); } @catch (id e) { |
︙ | ︙ | |||
290 291 292 293 294 295 296 | size_t numPreallocatedPages; # endif size_t i; if (preallocatedPages != NULL) @throw [OFInvalidArgumentException exception]; | | | 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 | size_t numPreallocatedPages; # endif size_t i; if (preallocatedPages != NULL) @throw [OFInvalidArgumentException exception]; preallocatedPages = of_alloc_zeroed(numPages, sizeof(struct page)); # if !defined(OF_HAVE_COMPILER_TLS) && defined(OF_HAVE_THREADS) of_tlskey_set(preallocatedPagesKey, preallocatedPages); # endif @try { for (i = 0; i < numPages; i++) preallocatedPages[i] = addPage(false); |
︙ | ︙ | |||
411 412 413 414 415 416 417 | size_t pageSize = [OFSystemInfo pageSize]; #endif if (count > SIZE_MAX / itemSize) @throw [OFOutOfRangeException exception]; if (allowsSwappableMemory) { | | | 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 | size_t pageSize = [OFSystemInfo pageSize]; #endif if (count > SIZE_MAX / itemSize) @throw [OFOutOfRangeException exception]; if (allowsSwappableMemory) { _items = of_alloc(count, itemSize); _freeWhenDone = true; memset(_items, 0, count * itemSize); #if defined(HAVE_MMAP) && defined(HAVE_MLOCK) && defined(MAP_ANON) } else if (count * itemSize >= pageSize) _items = mapPages(OF_ROUND_UP_POW2(pageSize, count * itemSize) / pageSize); else { |
︙ | ︙ |