version 1.23, 2014/05/12 19:11:20 |
version 1.24, 2014/10/11 03:57:13 |
|
|
static void *hash_calloc(size_t, size_t, void *); |
static void *hash_calloc(size_t, size_t, void *); |
static void hash_free(void *, void *); |
static void hash_free(void *, void *); |
static void* entry_alloc(size_t, void *); |
static void* entry_alloc(size_t, void *); |
static void *emalloc(size_t); |
static void *ereallocarray(void *, size_t, size_t); |
static void *emem(void *); |
static void *emem(void *); |
#define DEBUG_TRAVERSE 0 |
#define DEBUG_TRAVERSE 0 |
static struct ohash_info node_info = { |
static struct ohash_info node_info = { |
|
|
static void * |
static void * |
entry_alloc(size_t s, void *u UNUSED) |
entry_alloc(size_t s, void *u UNUSED) |
{ |
{ |
return emalloc(s); |
return ereallocarray(NULL, 1, s); |
} |
} |
|
|
static void * |
static void * |
emalloc(size_t s) |
ereallocarray(void *p, size_t n, size_t s) |
{ |
{ |
return emem(malloc(s)); |
return emem(reallocarray(p, n, s)); |
} |
} |
|
|
|
|
|
|
return; |
return; |
} |
} |
b->refs++; |
b->refs++; |
l = emalloc(sizeof(struct link)); |
l = ereallocarray(NULL, 1, sizeof(struct link)); |
l->node = b; |
l->node = b; |
l->next = a->arcs; |
l->next = a->arcs; |
a->arcs = l; |
a->arcs = l; |
|
|
struct node *n; |
struct node *n; |
unsigned int i; |
unsigned int i; |
|
|
heap->t = emalloc(sizeof(struct node *) * ohash_entries(hash)); |
heap->t = ereallocarray(NULL, ohash_entries(hash), |
remaining->t = emalloc(sizeof(struct node *) * ohash_entries(hash)); |
sizeof(struct node *)); |
|
remaining->t = ereallocarray(NULL, ohash_entries(hash), |
|
sizeof(struct node *)); |
heap->entries = 0; |
heap->entries = 0; |
remaining->entries = 0; |
remaining->entries = 0; |
|
|