#include "objfw-defs.h"
#include <stddef.h>
#include <stdint.h>
#include <stdbool.h>
#include <limits.h>
#include "block.h"
#include "macros.h"
#include "once.h"
#import "OFObject+KeyValueCoding.h"
#import "OFObject+Serialization.h"
Go to the source code of this file.
|
void *_Nullable | of_alloc (size_t count, size_t size) 1 |
| Allocates memory for the specified number of items of the specified size. More...
|
|
void *_Nullable | of_alloc_zeroed (size_t count, size_t size) 1 |
| Allocates memory for the specified number of items of the specified size and initializes it with zeros. More...
|
|
void *_Nullable | of_realloc (void *_Nullable pointer, size_t count, size_t size) 1 |
| Resizes memory to the specified number of items of the specified size. More...
|
|
◆ of_comparator_t
A comparator to compare two objects.
- Parameters
-
left | The left object |
right | The right object |
- Returns
- The order of the objects
◆ of_byte_order_t
An enum for storing endianess.
Enumerator |
---|
OF_BYTE_ORDER_BIG_ENDIAN | Most significant byte first (big endian)
|
OF_BYTE_ORDER_LITTLE_ENDIAN | Least significant byte first (little endian)
|
◆ of_comparison_result_t
A result of a comparison.
Enumerator |
---|
OF_ORDERED_ASCENDING | The left object is smaller than the right
|
OF_ORDERED_SAME | Both objects are equal
|
OF_ORDERED_DESCENDING | The left object is bigger than the right
|
◆ of_alloc()
void* _Nullable of_alloc |
( |
size_t |
count, |
|
|
size_t |
size |
|
) |
| |
Allocates memory for the specified number of items of the specified size.
To free the allocated memory, use free()
.
Throws OFOutOfMemoryException if allocating failed and OFOutOfRangeException if the requested size exceeds the address space.
- Parameters
-
count | The number of items to allocate |
size | The size of each item to allocate |
- Returns
- A pointer to the allocated memory. May return NULL if the specified size or count is 0.
◆ of_alloc_zeroed()
void* _Nullable of_alloc_zeroed |
( |
size_t |
count, |
|
|
size_t |
size |
|
) |
| |
Allocates memory for the specified number of items of the specified size and initializes it with zeros.
To free the allocated memory, use free()
.
Throws OFOutOfMemoryException if allocating failed and OFOutOfRangeException if the requested size exceeds the address space.
- Parameters
-
size | The size of each item to allocate |
count | The number of items to allocate |
- Returns
- A pointer to the allocated memory. May return NULL if the specified size or count is 0.
◆ of_realloc()
void* _Nullable of_realloc |
( |
void *_Nullable |
pointer, |
|
|
size_t |
count, |
|
|
size_t |
size |
|
) |
| |
Resizes memory to the specified number of items of the specified size.
To free the allocated memory, use free()
.
If the pointer is NULL, this is equivalent to allocating memory. If the size or number of items is 0, this is equivalent to freeing memory.
Throws OFOutOfMemoryException if allocating failed and OFOutOfRangeException if the requested size exceeds the address space.
- Parameters
-
pointer | A pointer to the already allocated memory |
size | The size of each item to resize to |
count | The number of items to resize to |
- Returns
- A pointer to the resized memory chunk