Overview
| Comment: | Remove -[allocZeroedMemoryWithSize:]
This is no longer being used. |
|---|---|
| Downloads: | Tarball | ZIP archive | SQL archive |
| Timelines: | family | ancestors | descendants | both | trunk |
| Files: | files | file ages | folders |
| SHA3-256: |
2bb3136a7f260a2cc9cbe0715def640f |
| User & Date: | js on 2020-11-05 02:35:43 |
| Other Links: | manifest | tags |
Context
|
2020-11-06
| ||
| 00:58 | OFList: Avoid -[allocMemoryWithSize:] (check-in: db15314420 user: js tags: trunk) | |
|
2020-11-05
| ||
| 02:35 | Remove -[allocZeroedMemoryWithSize:] (check-in: 2bb3136a7f user: js tags: trunk) | |
| 02:27 | Further reduce usage of -[allocMemoryWithSize:] (check-in: da1fb6b21c user: js tags: trunk) | |
Changes
Modified src/OFObject.h from [9d5edd8a16] to [19b99027a7].
| ︙ | ︙ | |||
827 828 829 830 831 832 833 | * @param count The number of items to allocate * @return A pointer to the allocated memory. May return NULL if the specified * size or count is 0. */ - (nullable void *)allocMemoryWithSize: (size_t)size count: (size_t)count OF_WARN_UNUSED_RESULT; | < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 827 828 829 830 831 832 833 834 835 836 837 838 839 840 | * @param count The number of items to allocate * @return A pointer to the allocated memory. May return NULL if the specified * size or count is 0. */ - (nullable void *)allocMemoryWithSize: (size_t)size count: (size_t)count OF_WARN_UNUSED_RESULT; /** * @brief Resizes memory in the object's memory pool to the specified size. * * If the pointer is NULL, this is equivalent to allocating memory. * If the size is 0, this is equivalent to freeing memory. * * @param pointer A pointer to the already allocated memory |
| ︙ | ︙ |
Modified src/OFObject.m from [2cf6c520ad] to [b6169ba098].
| ︙ | ︙ | |||
1138 1139 1140 1141 1142 1143 1144 |
{
if OF_UNLIKELY (count > SIZE_MAX / size)
@throw [OFOutOfRangeException exception];
return [self allocMemoryWithSize: size * count];
}
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 |
{
if OF_UNLIKELY (count > SIZE_MAX / size)
@throw [OFOutOfRangeException exception];
return [self allocMemoryWithSize: size * count];
}
- (void *)resizeMemory: (void *)pointer
size: (size_t)size
{
void *new;
struct pre_mem *preMem;
if OF_UNLIKELY (pointer == NULL)
|
| ︙ | ︙ |