132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
|
return pointer;
}
void *
OFResizeMemory(void *pointer, size_t count, size_t size)
{
if OF_UNLIKELY (count == 0 || size == 0)
return NULL;
if OF_UNLIKELY (count > SIZE_MAX / size)
@throw [OFOutOfRangeException exception];
if OF_UNLIKELY ((pointer = realloc(pointer, count * size)) == NULL)
@throw [OFOutOfMemoryException
exceptionWithRequestedSize: size];
|
|
>
>
|
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
|
return pointer;
}
void *
OFResizeMemory(void *pointer, size_t count, size_t size)
{
if OF_UNLIKELY (count == 0 || size == 0) {
free(pointer);
return NULL;
}
if OF_UNLIKELY (count > SIZE_MAX / size)
@throw [OFOutOfRangeException exception];
if OF_UNLIKELY ((pointer = realloc(pointer, count * size)) == NULL)
@throw [OFOutOfMemoryException
exceptionWithRequestedSize: size];
|