Mercurial > hg > Members > nobuyasu > CbC
view DPP/memory.h @ 3:4e98faa1d831
add automaton
author | Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 19 Apr 2012 13:41:11 +0900 |
parents | a89b61162c29 |
children | ac2555eeeb17 |
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 */