ReactOS 0.4.15-dev-7842-g558ab78
alloc.c File Reference
#include <rosdhcp.h>
Include dependency graph for alloc.c:

Go to the source code of this file.

Functions

struct string_listnew_string_list (size_t size)
 
struct hash_tablenew_hash_table (int count)
 
struct hash_bucketnew_hash_bucket (void)
 
void dfree (void *ptr, char *name)
 
void free_hash_bucket (struct hash_bucket *ptr, char *name)
 

Function Documentation

◆ dfree()

void dfree ( void ptr,
char name 
)

Definition at line 79 of file alloc.c.

80{
81 if (!ptr) {
82 warning("dfree %s: free on null pointer.", name);
83 return;
84 }
85 free(ptr);
86}
#define free
Definition: debug_ros.c:5
static PVOID ptr
Definition: dispmode.c:27
#define warning(s)
Definition: debug.h:83
Definition: name.c:39

Referenced by do_host_lookup(), free_hash_bucket(), tree_concat(), and tree_evaluate().

◆ free_hash_bucket()

void free_hash_bucket ( struct hash_bucket ptr,
char name 
)

Definition at line 89 of file alloc.c.

90{
91 dfree(ptr, name);
92}
void dfree(void *ptr, char *name)
Definition: alloc.c:79

Referenced by delete_hash_entry().

◆ new_hash_bucket()

struct hash_bucket * new_hash_bucket ( void  )

Definition at line 71 of file alloc.c.

72{
73 struct hash_bucket *rval = calloc(1, sizeof(struct hash_bucket));
74
75 return (rval);
76}
float rval
Definition: cylfrac.c:48
#define calloc
Definition: rosglue.h:14

Referenced by add_hash().

◆ new_hash_table()

struct hash_table * new_hash_table ( int  count)

Definition at line 57 of file alloc.c.

58{
59 struct hash_table *rval;
60
61 rval = calloc(1, sizeof(struct hash_table) -
62 (DEFAULT_HASH_SIZE * sizeof(struct hash_bucket *)) +
63 (count * sizeof(struct hash_bucket *)));
64 if (rval == NULL)
65 return (NULL);
66 rval->hash_count = count;
67 return (rval);
68}
#define DEFAULT_HASH_SIZE
Definition: dhcpd.h:259
#define NULL
Definition: types.h:112
GLuint GLuint GLsizei count
Definition: gl.h:1545

Referenced by new_hash().

◆ new_string_list()

struct string_list * new_string_list ( size_t  size)

Definition at line 46 of file alloc.c.

47{
48 struct string_list *rval;
49
50 rval = calloc(1, sizeof(struct string_list) + size);
51 if (rval != NULL)
52 rval->string = ((char *)rval) + sizeof(struct string_list);
53 return (rval);
54}
GLsizeiptr size
Definition: glext.h:5919