1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
|
- (void *)allocMemoryWithSize: (size_t)size
{
void *pointer;
struct pre_mem *preMem;
if OF_UNLIKELY (size == 0)
return NULL;
if OF_UNLIKELY (size > SIZE_MAX - PRE_IVARS_ALIGN)
@throw [OFOutOfRangeException exception];
if OF_UNLIKELY ((pointer = malloc(PRE_MEM_ALIGN + size)) == NULL)
@throw [OFOutOfMemoryException
exceptionWithRequestedSize: size];
|
|
|
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
|
- (void *)allocMemoryWithSize: (size_t)size
{
void *pointer;
struct pre_mem *preMem;
if OF_UNLIKELY (size == 0)
return (void *_Nonnull)NULL;
if OF_UNLIKELY (size > SIZE_MAX - PRE_IVARS_ALIGN)
@throw [OFOutOfRangeException exception];
if OF_UNLIKELY ((pointer = malloc(PRE_MEM_ALIGN + size)) == NULL)
@throw [OFOutOfMemoryException
exceptionWithRequestedSize: size];
|