Skip to content

Commit 7e192a4

Browse files
committed
rename everything with MEM prefix to ALLOC prefix and fix includes
1 parent 3ed4ffd commit 7e192a4

31 files changed

Lines changed: 123 additions & 126 deletions

include/express/alg.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -119,16 +119,16 @@ extern SC_EXPRESS_EXPORT struct freelist_head WHERE_fl;
119119
/* macro function definitions */
120120
/******************************/
121121

122-
#define ALG_new() (struct Algorithm *)MEM_new(&ALG_fl);
123-
#define ALG_destroy(x) MEM_destroy(&ALG_fl,(Freelist *)x)
124-
#define FUNC_new() (struct Function_ *)MEM_new(&FUNC_fl)
125-
#define FUNC_destroy(x) MEM_destroy(&FUNC_fl,(Freelist *)x)
126-
#define RULE_new() (struct Rule_ *)MEM_new(&RULE_fl)
127-
#define RULE_destroy(x) MEM_destroy(&RULE_fl,(Freelist *)x)
128-
#define PROC_new() (struct Procedure_ *)MEM_new(&PROC_fl)
129-
#define PROC_destroy(x) MEM_destroy(&PROC_fl,(Freelist *)x)
130-
#define WHERE_new() (struct Where_ *)MEM_new(&WHERE_fl)
131-
#define WHERE_destroy(x) MEM_destroy(&WHERE_fl,(Freelist *)x)
122+
#define ALG_new() (struct Algorithm *)ALLOC_new(&ALG_fl);
123+
#define ALG_destroy(x) ALLOC_destroy(&ALG_fl,(Freelist *)x)
124+
#define FUNC_new() (struct Function_ *)ALLOC_new(&FUNC_fl)
125+
#define FUNC_destroy(x) ALLOC_destroy(&FUNC_fl,(Freelist *)x)
126+
#define RULE_new() (struct Rule_ *)ALLOC_new(&RULE_fl)
127+
#define RULE_destroy(x) ALLOC_destroy(&RULE_fl,(Freelist *)x)
128+
#define PROC_new() (struct Procedure_ *)ALLOC_new(&PROC_fl)
129+
#define PROC_destroy(x) ALLOC_destroy(&PROC_fl,(Freelist *)x)
130+
#define WHERE_new() (struct Where_ *)ALLOC_new(&WHERE_fl)
131+
#define WHERE_destroy(x) ALLOC_destroy(&WHERE_fl,(Freelist *)x)
132132

133133
#define ALGput_name(algorithm, name) SCOPEput_name(algorithm,name)
134134
#define ALGget_name(algorithm) SCOPEget_name(algorithm)

include/express/alloc.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#ifndef MEMORY_H
2-
#define MEMORY_H
1+
#ifndef ALLOC_H
2+
#define ALLOC_H
33

44
/*
55
* This work was supported by the United States Government, and is
@@ -30,7 +30,7 @@
3030

3131
#include <sc_export.h>
3232

33-
/** \file memory.h - defs for fixed size block memory allocator */
33+
/** \file alloc.h - defs for fixed size block memory allocator */
3434

3535
typedef long Align;
3636

@@ -75,11 +75,11 @@ extern SC_EXPRESS_EXPORT int yylineno;
7575
fprintf(stderr,"fedex: out of space");\
7676
} else {}
7777

78-
SC_EXPRESS_EXPORT void _MEMinitialize( void );
79-
SC_EXPRESS_EXPORT void MEMinitialize( struct freelist_head * flh, unsigned int size, int alloc1, int alloc2 );
80-
SC_EXPRESS_EXPORT void MEM_destroy( struct freelist_head *, Freelist * );
81-
SC_EXPRESS_EXPORT void * MEM_new( struct freelist_head * );
78+
SC_EXPRESS_EXPORT void _ALLOCinitialize( void );
79+
SC_EXPRESS_EXPORT void ALLOCinitialize( struct freelist_head * flh, unsigned int size, int alloc1, int alloc2 );
80+
SC_EXPRESS_EXPORT void ALLOC_destroy( struct freelist_head *, Freelist * );
81+
SC_EXPRESS_EXPORT void * ALLOC_new( struct freelist_head * );
8282

83-
#endif /* MEMORY_H */
83+
#endif /* ALLOC_H */
8484

8585

include/express/caseitem.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ extern SC_EXPRESS_EXPORT struct freelist_head CASE_IT_fl;
8383
/* function prototypes */
8484
/***********************/
8585

86-
#define CASE_IT_new() (struct Case_Item_ *)MEM_new(&CASE_IT_fl)
87-
#define CASE_IT_destroy(x) MEM_destroy(&CASE_IT_fl,(Freelist *)x)
86+
#define CASE_IT_new() (struct Case_Item_ *)ALLOC_new(&CASE_IT_fl)
87+
#define CASE_IT_destroy(x) ALLOC_destroy(&CASE_IT_fl,(Freelist *)x)
8888

8989
extern SC_EXPRESS_EXPORT Case_Item CASE_ITcreate( Linked_List, struct Statement_ * );
9090
extern SC_EXPRESS_EXPORT void CASE_ITinitialize( void );

include/express/entity.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ extern SC_EXPRESS_EXPORT int ENTITY_MARK;
109109
/* macro function definitions */
110110
/******************************/
111111

112-
#define ENTITY_new() (struct Entity_ *)MEM_new(&ENTITY_fl)
113-
#define ENTITY_destroy(x) MEM_destroy(&ENTITY_fl,(Freelist *)(char *)x)
112+
#define ENTITY_new() (struct Entity_ *)ALLOC_new(&ENTITY_fl)
113+
#define ENTITY_destroy(x) ALLOC_destroy(&ENTITY_fl,(Freelist *)(char *)x)
114114

115115
#define ENTITYget_symbol(e) SCOPEget_symbol(e)
116116
/* returns a function (i.e., which can be passed to other functions) */

include/express/error.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
/* packages used */
4444
/*****************/
4545

46-
#include "memory.h"
46+
#include "alloc.h"
4747
#include "symbol.h"
4848

4949
/************/
@@ -110,8 +110,8 @@ extern SC_EXPRESS_EXPORT void ( *ERRORusage_function )( void );
110110
/* macro function definitions */
111111
/******************************/
112112

113-
#define ERROR_OPT_new() (struct Error_Warning_ *)MEM_new(&ERROR_OPT_fl)
114-
#define ERROR_OPT_destroy(x) MEM_destroy(&ERROR_OPT_fl,(Freelist *)x)
113+
#define ERROR_OPT_new() (struct Error_Warning_ *)ALLOC_new(&ERROR_OPT_fl)
114+
#define ERROR_OPT_destroy(x) ALLOC_destroy(&ERROR_OPT_fl,(Freelist *)x)
115115

116116
/***********************/
117117
/* function prototypes */

include/express/expbasic.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ typedef void * ClientData;
5454
/* packages used throughout */
5555
/****************************/
5656

57-
#include "memory.h"
57+
#include "alloc.h"
5858

5959
typedef struct Scope_ * Type;
6060
typedef struct Scope_ * Scope;

include/express/expr.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -207,14 +207,14 @@ extern SC_EXPRESS_EXPORT struct freelist_head QUAL_ATTR_fl;
207207
/* macro function definitions */
208208
/******************************/
209209

210-
#define EXP_new() (struct Expression_ *)MEM_new(&EXP_fl)
211-
#define EXP_destroy(x) MEM_destroy(&EXP_fl,(Freelist *)x)
212-
#define OP_new() (struct Op_Subexpression *)MEM_new(&OP_fl)
213-
#define OP_destroy(x) MEM_destroy(&OP_fl,(Freelist *)x)
214-
#define QUERY_new() (struct Query_ *)MEM_new(&QUERY_fl)
215-
#define QUERY_destroy(x) MEM_destroy(&QUERY_fl,(Freelist *)x)
216-
#define QUAL_ATTR_new() (struct Qualified_Attr *)MEM_new(&QUAL_ATTR_fl)
217-
#define QUAL_ATTR_destroy(x) MEM_destroy(&QUAL_ATTR_fl,(Freelist *)x)
210+
#define EXP_new() (struct Expression_ *)ALLOC_new(&EXP_fl)
211+
#define EXP_destroy(x) ALLOC_destroy(&EXP_fl,(Freelist *)x)
212+
#define OP_new() (struct Op_Subexpression *)ALLOC_new(&OP_fl)
213+
#define OP_destroy(x) ALLOC_destroy(&OP_fl,(Freelist *)x)
214+
#define QUERY_new() (struct Query_ *)ALLOC_new(&QUERY_fl)
215+
#define QUERY_destroy(x) ALLOC_destroy(&QUERY_fl,(Freelist *)x)
216+
#define QUAL_ATTR_new() (struct Qualified_Attr *)ALLOC_new(&QUAL_ATTR_fl)
217+
#define QUAL_ATTR_destroy(x) ALLOC_destroy(&QUAL_ATTR_fl,(Freelist *)x)
218218

219219
#define EXPget_name(e) ((e)->symbol.name)
220220
#define ENUMget_name(e) ((e)->symbol.name)

include/express/hash.h

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101
/*****************/
102102

103103
#include <sc_export.h>
104-
#include "memory.h"
104+
#include "alloc.h"
105105

106106
/************/
107107
/* typedefs */
@@ -183,11 +183,10 @@ This change only seems to have affected hash.h and hash.c
183183
#define DIV(x,y) ((x) >> (y))
184184
#define MOD(x,y) ((x) & ((y)-1))
185185

186-
#define HASH_Table_new() (struct Hash_Table_ *)MEM_new(&HASH_Table_fl)
187-
#define HASH_Table_destroy(x) MEM_destroy(&HASH_Table_fl,(Freelist *)x)
188-
#define HASH_Element_new() (struct Element_ *)MEM_new(&HASH_Element_fl)
189-
#define HASH_Element_destroy(x) MEM_destroy(&HASH_Element_fl,(Freelist *)(char *)x)
190-
186+
#define HASH_Table_new() (struct Hash_Table_ *)ALLOC_new(&HASH_Table_fl)
187+
#define HASH_Table_destroy(x) ALLOC_destroy(&HASH_Table_fl,(Freelist *)x)
188+
#define HASH_Element_new() (struct Element_ *)ALLOC_new(&HASH_Element_fl)
189+
#define HASH_Element_destroy(x) ALLOC_destroy(&HASH_Element_fl,(Freelist *)(char *)x)
191190

192191
/***********************/
193192
/* function prototypes */

include/express/linklist.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838

3939
#include <sc_export.h>
4040
#include "basic.h"
41-
#include "memory.h"
41+
#include "alloc.h"
4242

4343
/************/
4444
/* typedefs */
@@ -78,10 +78,10 @@ extern SC_EXPRESS_EXPORT struct freelist_head LIST_fl;
7878
/* macro function definitions */
7979
/******************************/
8080

81-
#define LINK_new() (struct Link_ *)MEM_new(&LINK_fl)
82-
#define LINK_destroy(x) MEM_destroy(&LINK_fl,(Freelist *)x)
83-
#define LIST_new() (struct Linked_List_ *)MEM_new(&LIST_fl)
84-
#define LIST_destroy(x) MEM_destroy(&LIST_fl,(Freelist *)x)
81+
#define LINK_new() (struct Link_ *)ALLOC_new(&LINK_fl)
82+
#define LINK_destroy(x) ALLOC_destroy(&LINK_fl,(Freelist *)x)
83+
#define LIST_new() (struct Linked_List_ *)ALLOC_new(&LIST_fl)
84+
#define LIST_destroy(x) ALLOC_destroy(&LIST_fl,(Freelist *)x)
8585

8686
/** accessing links */
8787
#define LINKdata(link) (link)->data

include/express/schema.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -117,12 +117,12 @@ extern SC_EXPRESS_EXPORT int __SCOPE_search_id;
117117
#define SCHEMAget_name(schema) SCOPEget_name(schema)
118118
#define SCHEMAget_symbol(schema) SCOPEget_symbol(schema)
119119

120-
#define REN_new() (struct Rename *)MEM_new(&REN_fl)
121-
#define REN_destroy(x) MEM_destroy(&REN_fl,(Freelist *)x)
122-
#define SCOPE_new() (struct Scope_ *)MEM_new(&SCOPE_fl)
123-
#define SCOPE_destroy(x) MEM_destroy(&SCOPE_fl,(Freelist *)x)
124-
#define SCHEMA_new() (struct Schema_ *)MEM_new(&SCHEMA_fl)
125-
#define SCHEMA_destroy(x) MEM_destroy(&SCHEMA_fl,(Freelist *)x)
120+
#define REN_new() (struct Rename *)ALLOC_new(&REN_fl)
121+
#define REN_destroy(x) ALLOC_destroy(&REN_fl,(Freelist *)x)
122+
#define SCOPE_new() (struct Scope_ *)ALLOC_new(&SCOPE_fl)
123+
#define SCOPE_destroy(x) ALLOC_destroy(&SCOPE_fl,(Freelist *)x)
124+
#define SCHEMA_new() (struct Schema_ *)ALLOC_new(&SCHEMA_fl)
125+
#define SCHEMA_destroy(x) ALLOC_destroy(&SCHEMA_fl,(Freelist *)x)
126126

127127
/* the following is simply to make the resulting code easier to read */
128128
/* otherwise, you'd see "entity->superscope" even when you KNOW */

0 commit comments

Comments
 (0)