Differences From Artifact [e2e795413b]:
- File src/OFObject.m — part of check-in [4fbdca698c] at 2020-11-07 20:23:04 on branch trunk — OFObject: Remove -[allocMemoryWithSize:] (user: js, size: 27692) [annotate] [blame] [check-ins using] [more...]
To Artifact [dfafb38c1f]:
- File
src/OFObject.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: 27697) [annotate] [blame] [check-ins using] [more...]
︙ | ︙ | |||
95 96 97 98 99 100 101 | static struct { Class isa; } allocFailedException; uint32_t of_hash_seed; void * | | | | 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 | static struct { Class isa; } allocFailedException; uint32_t of_hash_seed; void * of_alloc(size_t count, size_t size) { void *pointer; if OF_UNLIKELY (count == 0 || size == 0) return NULL; if OF_UNLIKELY (count > SIZE_MAX / size) @throw [OFOutOfRangeException exception]; if OF_UNLIKELY ((pointer = malloc(count * size)) == NULL) @throw [OFOutOfMemoryException exceptionWithRequestedSize: size]; return pointer; } void * of_alloc_zeroed(size_t count, size_t size) { void *pointer; if OF_UNLIKELY (count == 0 || size == 0) return NULL; /* Not all calloc implementations check for overflow. */ |
︙ | ︙ |