Verilog Parser
verilog_ast_mem.h
Go to the documentation of this file.
1 
7 #include <stdio.h>
8 #include <stdarg.h>
9 #include <stdlib.h>
10 #include <string.h>
11 
12 #ifndef VERILOG_AST_MEM_H
13 #define VERILOG_AST_MEM_H
14 
16 typedef struct ast_memory_t ast_memory;
17 
19 struct ast_memory_t{
20  size_t size;
21  void * data;
22  ast_memory * next;
23 };
24 
25 
27 void ast_free_all();
28 
30 char * ast_strdup(char * in);
31 
42 void * ast_calloc(size_t num, size_t size);
43 
44 
45 
46 #endif
47 
char * ast_strdup(char *in)
Duplicates the supplied null terminated string.
Definition: verilog_ast_mem.c:97
size_t size
Amount of memory allocated.
Definition: verilog_ast_mem.h:20
void ast_free_all()
Iterates over all allocated memory and frees it.
Definition: verilog_ast_mem.c:75
ast_memory * next
Next element to be allocated.
Definition: verilog_ast_mem.h:22
void * data
Pointer to the allocated memory.
Definition: verilog_ast_mem.h:21
Stores information on some allocated memory as a linked list.
Definition: verilog_ast_mem.h:19
void * ast_calloc(size_t num, size_t size)
A simple wrapper around calloc.
Definition: verilog_ast_mem.c:37