#include <stdlib.h>
#include <sys/mman.h>
Functions |
| void * | xmalloc (size_t) FNATTR_MALLOC |
| | Self-checking wrapper to malloc()
|
| void * | xcalloc (size_t, size_t) FNATTR_MALLOC |
| | Self-checking wrapper to calloc()
|
| void * | xrealloc (void *, size_t) FNATTR_MALLOC |
| | Self-checking wrapper to realloc()
|
| void * | xmmap (void *addr, size_t len, int prot, int flags, int fd, off_t offset) |
| | Self-checking wrapper to mmap()
|
| void | xelemset (int64_t *s, int64_t c, int64_t n) |
| | Initialize all elements of an array.
|
| void | xelemcpy (int64_t *dest, int64_t *src, int64_t n) |
| | Copy from one array to another.
|
| void | xzero (void *x, const size_t sz) |
| | Write zeros to sz bytes starting at x.
|
Macro Definition Documentation
Value:{ \
if (p != NULL) { \
free(p); \
p = NULL; \
} \
}
Self-checking wrapper to free()
- Parameters
-
Function Documentation
| void* xcalloc |
( |
size_t |
nelem, |
|
|
size_t |
sz |
|
) |
| |
| void xelemcpy |
( |
int64_t * |
dest, |
|
|
int64_t * |
src, |
|
|
int64_t |
num |
|
) |
| |
| void xelemset |
( |
int64_t * |
s, |
|
|
int64_t |
c, |
|
|
int64_t |
num |
|
) |
| |
Initialize all elements of an array.
- Parameters
-
| s | Array to initialize |
| c | Value to set |
| num | Number of elements in the array |
| void* xmalloc |
( |
size_t |
sz | ) |
|
Self-checking wrapper to malloc()
- Parameters
-
| sz | Number of bytes to allocate |
- Returns
Referenced by bucket_sort_pairs(), counting_sort(), edge_list_to_stinger(), radix_sort_pairs(), snarf_actions(), snarf_graph(), stinger_iterator_edge_type_filter(), stinger_iterator_new(), stinger_iterator_vertex_filter(), stinger_iterator_vertex_type_filter(), stinger_new(), stinger_open_from_file(), stinger_remove_and_insert_batch(), stinger_save_to_file(), stinger_sort_actions(), stinger_to_sorted_csr(), and stinger_to_unsorted_csr().
| void* xmmap |
( |
void * |
addr, |
|
|
size_t |
len, |
|
|
int |
prot, |
|
|
int |
flags, |
|
|
int |
fd, |
|
|
off_t |
offset |
|
) |
| |
Self-checking wrapper to mmap()
- Parameters
-
| addr | Starting address for new mapping |
| len | Length of the mapping |
| prot | Memory protection of the mapping |
| flags | MAP_SHARED or MAP_PRIVATE, plus other flags |
| fd | File descriptor |
| offset | Offset |
- Returns
| void* xrealloc |
( |
void * |
p, |
|
|
size_t |
sz |
|
) |
| |
Self-checking wrapper to realloc()
- Parameters
-
| p | Pointer to current allocation |
| sz | Number of bytes of new allocation |
- Returns
| void xzero |
( |
void * |
x, |
|
|
const size_t |
sz |
|
) |
| |
Write zeros to sz bytes starting at x.
- Parameters
-
| x | Pointer to memory location |
| sz | Memory size in bytes |
References MTASTREAMS.
Referenced by new_ebs().