Use a string pool to reduce the memory footprint
git-svn-id: svn://svn.cc65.org/cc65/trunk@2197 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
@@ -50,6 +50,7 @@
|
||||
|
||||
|
||||
struct LineInfo;
|
||||
struct ObjData;
|
||||
struct Section;
|
||||
|
||||
|
||||
@@ -61,9 +62,9 @@ struct Section;
|
||||
|
||||
|
||||
/* Fragment check expression */
|
||||
typedef struct CheckExpr CheckExpr;
|
||||
struct CheckExpr {
|
||||
struct CheckExpr* Next; /* Next check expression */
|
||||
typedef struct FragCheck FragCheck;
|
||||
struct FragCheck {
|
||||
struct FragCheck* Next; /* Next check expression */
|
||||
struct ExprNode* Expr; /* The expression itself */
|
||||
unsigned Action; /* Action to take if the check fails */
|
||||
unsigned Message; /* Message number */
|
||||
@@ -76,9 +77,9 @@ struct Fragment {
|
||||
struct ObjData* Obj; /* Source of fragment */
|
||||
unsigned Size; /* Size of data/expression */
|
||||
struct ExprNode* Expr; /* Expression if FRAG_EXPR */
|
||||
FilePos Pos; /* File position in source */
|
||||
FilePos Pos; /* File position in source */
|
||||
struct LineInfo* LI; /* Additional line info */
|
||||
CheckExpr* Check; /* Single linked list of expressions */
|
||||
FragCheck* Check; /* Single linked list of checks */
|
||||
unsigned char Type; /* Type of fragment */
|
||||
unsigned char LitBuf [1]; /* Dynamically alloc'ed literal buffer */
|
||||
};
|
||||
@@ -91,6 +92,9 @@ struct Fragment {
|
||||
|
||||
|
||||
|
||||
FragCheck* ReadFragCheck (FILE* F, Fragment* Frag);
|
||||
/* Read a fragment check expression from the given file */
|
||||
|
||||
Fragment* NewFragment (unsigned char Type, unsigned Size, struct Section* S);
|
||||
/* Create a new fragment and insert it into the section S */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user