1 Star 0 Fork 0

hongcez/verilog-parser

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
verilog_ast_mem.h 1.32 KB
一键复制 编辑 原始数据 按行查看 历史
Bo-Yuan Huang 提交于 2018-12-20 23:22 +08:00 . Moving headers into the wrapped dir
/*!
@file verilog_ast_mem.h
@brief Contains Declarations of datastructures and functions for helping to
manage dynamic memory allocation within the library.
*/
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
#ifndef VERILOG_AST_MEM_H
#define VERILOG_AST_MEM_H
//! Typedef over ast_memory_T
typedef struct ast_memory_t ast_memory;
//! Stores information on some allocated memory as a linked list.
struct ast_memory_t{
size_t size; //!< Amount of memory allocated.
void * data; //!< Pointer to the allocated memory.
ast_memory * next; //!< Next element to be allocated.
};
//! Iterates over all allocated memory and frees it.
void ast_free_all();
//! Duplicates the supplied null terminated string.
char * ast_strdup(char * in);
/*!
@brief A simple wrapper around calloc.
@details This function is identical to calloc, but uses the head and
walker variables above to keep a linked list of all heap memory that the
AST construction allocates. This makes it very easy to clean up afterward
using the @ref ast_free_all function.
@param [in] num - Number of elements to allocate space for.
@param [in] size - The size of each element being allocated.
@returns A pointer to the start of the block of memory allocated.
*/
void * ast_calloc(size_t num, size_t size);
#endif
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/hongcez/verilog-parser.git
git@gitee.com:hongcez/verilog-parser.git
hongcez
verilog-parser
verilog-parser
master

搜索帮助