Mercurial > hg > CbC > old > DPP
view memory.h @ 0:d4bc23cb728b
Import from CVS (CVS_DB/member/atsuki/cbc/DPP)
author | Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp> |
---|---|
date | Wed, 16 Dec 2015 15:16:11 +0900 |
parents | |
children |
line wrap: on
line source
#ifndef _MEMORY_H_ #define _MEMORY_H_ typedef struct memory { void *adr; int length; void *body; int hash; struct memory *left,*right; } Memory, *MemoryPtr; extern void die_exit(char *); extern MemoryPtr create_memory(void *adr, int length); extern void compute_memory_hash1(MemoryPtr m); extern void free_memory(MemoryPtr m); extern int cmp_content(MemoryPtr a,MemoryPtr b); extern int cmp_memory(MemoryPtr a,MemoryPtr b); extern MemoryPtr copy_memory(MemoryPtr m, MemoryPtr *db); extern void restore_memory(MemoryPtr m) ; extern int get_memory_hash(MemoryPtr m, int hash); MemoryPtr add_memory(void *ptr,int length, MemoryPtr *parent); extern int memory_lookup(MemoryPtr m, MemoryPtr *parent, MemoryPtr (*new_memory)(MemoryPtr), MemoryPtr *out); extern MemoryPtr add_memory_range(void *ptr,int length, MemoryPtr *parent); extern int memory_range_lookup(MemoryPtr m, MemoryPtr *parent, MemoryPtr *out); extern void memory_usage(); #endif /* end */