An extensible data structure for massive streaming graphs
|
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <string.h>
#include <assert.h>
#include "xmalloc.h"
#include "stinger.h"
Functions | |
void * | xmalloc (size_t sz) |
Self-checking wrapper to malloc() | |
void * | xcalloc (size_t nelem, size_t sz) |
Self-checking wrapper to calloc() | |
void * | xrealloc (void *p, size_t sz) |
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 num) |
Initialize all elements of an array. | |
void | xelemcpy (int64_t *dest, int64_t *src, int64_t num) |
Copy from one array to another. | |
void | xzero (void *x, const size_t sz) |
Write zeros to sz bytes starting at x. |
void* xcalloc | ( | size_t | nelem, |
size_t | sz | ||
) |
Self-checking wrapper to calloc()
nelem | Number of elements |
sz | Size of each element |
Referenced by stinger_new(), stinger_open_from_file(), stinger_save_to_file(), stinger_set_initial_edges(), and stinger_to_unsorted_csr().
void xelemcpy | ( | int64_t * | dest, |
int64_t * | src, | ||
int64_t | num | ||
) |
Copy from one array to another.
dest | Output array |
src | Input array |
num | Number of elements to copy |
Referenced by stinger_iterator_edge_type_filter(), stinger_iterator_vertex_filter(), and stinger_iterator_vertex_type_filter().
void xelemset | ( | int64_t * | s, |
int64_t | c, | ||
int64_t | num | ||
) |
Initialize all elements of an array.
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()
sz | Number of bytes to allocate |
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()
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 |
void* xrealloc | ( | void * | p, |
size_t | sz | ||
) |
Self-checking wrapper to realloc()
p | Pointer to current allocation |
sz | Number of bytes of new allocation |
void xzero | ( | void * | x, |
const size_t | sz | ||
) |
Write zeros to sz bytes starting at x.
x | Pointer to memory location |
sz | Memory size in bytes |
References MTASTREAMS.
Referenced by new_ebs().
comments powered by Disqus