2 |
- |
1 |
/* Copyright (C) 1993, 2000 Aladdin Enterprises. All rights reserved.
|
|
|
2 |
|
|
|
3 |
This software is provided AS-IS with no warranty, either express or
|
|
|
4 |
implied.
|
|
|
5 |
|
|
|
6 |
This software is distributed under license and may not be copied,
|
|
|
7 |
modified or distributed except as expressly authorized under the terms
|
|
|
8 |
of the license contained in the file LICENSE in this distribution.
|
|
|
9 |
|
|
|
10 |
For more information about licensing, please refer to
|
|
|
11 |
http://www.ghostscript.com/licensing/. For information on
|
|
|
12 |
commercial licensing, go to http://www.artifex.com/licensing/ or
|
|
|
13 |
contact Artifex Software, Inc., 101 Lucas Valley Road #110,
|
|
|
14 |
San Rafael, CA 94903, U.S.A., +1(415)492-9861.
|
|
|
15 |
*/
|
|
|
16 |
|
|
|
17 |
/* $Id: gsstruct.h,v 1.22 2005/09/06 17:18:43 leonardo Exp $ */
|
|
|
18 |
/* Definitions for Ghostscript modules that define allocatable structures */
|
|
|
19 |
/* Requires gstypes.h */
|
|
|
20 |
|
|
|
21 |
#ifndef gsstruct_INCLUDED
|
|
|
22 |
# define gsstruct_INCLUDED
|
|
|
23 |
|
|
|
24 |
#include "gsstype.h"
|
|
|
25 |
|
|
|
26 |
/*
|
|
|
27 |
* Ghostscript structures are defined with names of the form (gs_)xxx_s,
|
|
|
28 |
* with a corresponding typedef of the form (gs_)xxx or (gs_)xxx_t.
|
|
|
29 |
* By extension, the structure descriptor is named st_[gs_]xxx.
|
|
|
30 |
* (Note that the descriptor name may omit the gs_ even if the type has it.)
|
|
|
31 |
* Structure descriptors are always allocated statically and are
|
|
|
32 |
* always const; they may be either public or private.
|
|
|
33 |
*
|
|
|
34 |
* In order to ensure that there is a descriptor for each structure type,
|
|
|
35 |
* we require, by convention, that the following always appear together
|
|
|
36 |
* if the structure is defined in a .h file:
|
|
|
37 |
* - The definition of the structure xxx_s;
|
|
|
38 |
* - If the descriptor is public, an extern_st(st_xxx);
|
|
|
39 |
* - The definition of a macro public_st_xxx() or private_st_xxx()
|
|
|
40 |
* that creates the actual descriptor.
|
|
|
41 |
* This convention makes the descriptor visible (if public) to any module
|
|
|
42 |
* that can see the structure definition. This is more liberal than
|
|
|
43 |
* we would like, but it is a reasonable compromise between restricting
|
|
|
44 |
* visibility and keeping all the definitional elements of a structure
|
|
|
45 |
* together. We require that there be no other externs for (public)
|
|
|
46 |
* structure descriptors; if the definer of a structure wants to make
|
|
|
47 |
* available the ability to create an instance but does not want to
|
|
|
48 |
* expose the structure definition, it must export a creator procedure.
|
|
|
49 |
*/
|
|
|
50 |
/*
|
|
|
51 |
* If the structure is defined in a .c file, we require that the following
|
|
|
52 |
* appear together:
|
|
|
53 |
* - The definition of the structure xxx_s;
|
|
|
54 |
* - The gs_private_st_xxx macro that creates the descriptor.
|
|
|
55 |
* Note that we only allow this if the structure is completely private
|
|
|
56 |
* to a single file. Again, the file must export a creator procedure
|
|
|
57 |
* if it wants external clients to be able to create instances.
|
|
|
58 |
*
|
|
|
59 |
* Some structures are embedded inside others. In order to be able to
|
|
|
60 |
* construct the composite pointer enumeration procedures, for such
|
|
|
61 |
* structures we must define not only the st_xxx descriptor, but also
|
|
|
62 |
* a st_xxx_max_ptrs constant that gives the maximum number of pointers
|
|
|
63 |
* the enumeration procedure will return. This is an unfortunate consequence
|
|
|
64 |
* of the method we have chosen for implementing pointer enumeration.
|
|
|
65 |
*
|
|
|
66 |
* Some structures may exist as elements of homogenous arrays.
|
|
|
67 |
* In order to be able to enumerate and relocate such arrays, we adopt
|
|
|
68 |
* the convention that the structure representing an element must be
|
|
|
69 |
* distinguished from the structure per se, and the name of the element
|
|
|
70 |
* structure always ends with "_element". Element structures cannot be
|
|
|
71 |
* embedded in other structures.
|
|
|
72 |
*
|
|
|
73 |
* Note that the definition of the xxx_s structure may be separate from
|
|
|
74 |
* the typedef for the type xxx(_t). This still allows us to have full
|
|
|
75 |
* structure type abstraction.
|
|
|
76 |
*
|
|
|
77 |
* Descriptor definitions are not required for structures to which
|
|
|
78 |
* no traceable pointers from garbage-collectable space will ever exist.
|
|
|
79 |
* For example, the struct that defines structure types themselves does not
|
|
|
80 |
* require a descriptor.
|
|
|
81 |
*/
|
|
|
82 |
|
|
|
83 |
/* An opaque type for an object header. */
|
|
|
84 |
#ifndef obj_header_DEFINED
|
|
|
85 |
# define obj_header_DEFINED
|
|
|
86 |
typedef struct obj_header_s obj_header_t;
|
|
|
87 |
#endif
|
|
|
88 |
|
|
|
89 |
/*
|
|
|
90 |
* Define pointer types, which define how to mark the referent of the
|
|
|
91 |
* pointer.
|
|
|
92 |
*/
|
|
|
93 |
/*typedef struct gs_ptr_procs_s gs_ptr_procs_t;*/ /* in gsmemory.h */
|
|
|
94 |
struct gs_ptr_procs_s {
|
|
|
95 |
|
|
|
96 |
/* Unmark the referent of a pointer. */
|
|
|
97 |
|
|
|
98 |
#define ptr_proc_unmark(proc)\
|
|
|
99 |
void proc(enum_ptr_t *, gc_state_t *)
|
|
|
100 |
ptr_proc_unmark((*unmark));
|
|
|
101 |
|
|
|
102 |
/* Mark the referent of a pointer. */
|
|
|
103 |
/* Return true iff it was unmarked before. */
|
|
|
104 |
|
|
|
105 |
#define ptr_proc_mark(proc)\
|
|
|
106 |
bool proc(enum_ptr_t *, gc_state_t *)
|
|
|
107 |
ptr_proc_mark((*mark));
|
|
|
108 |
|
|
|
109 |
/* Relocate a pointer. */
|
|
|
110 |
/* Note that the argument is const, but the */
|
|
|
111 |
/* return value is not: this shifts the compiler */
|
|
|
112 |
/* 'discarding const' warning from the call sites */
|
|
|
113 |
/* (the reloc_ptr routines) to the implementations. */
|
|
|
114 |
|
|
|
115 |
#define ptr_proc_reloc(proc, typ)\
|
|
|
116 |
typ *proc(const typ *, gc_state_t *)
|
|
|
117 |
ptr_proc_reloc((*reloc), void);
|
|
|
118 |
|
|
|
119 |
};
|
|
|
120 |
/*typedef const gs_ptr_procs_t *gs_ptr_type_t;*/ /* in gsmemory.h */
|
|
|
121 |
|
|
|
122 |
/* Define the pointer type for ordinary structure pointers. */
|
|
|
123 |
extern const gs_ptr_procs_t ptr_struct_procs;
|
|
|
124 |
#define ptr_struct_type (&ptr_struct_procs)
|
|
|
125 |
|
|
|
126 |
/* Define the pointer types for a pointer to a gs_[const_]string. */
|
|
|
127 |
extern const gs_ptr_procs_t ptr_string_procs;
|
|
|
128 |
#define ptr_string_type (&ptr_string_procs)
|
|
|
129 |
extern const gs_ptr_procs_t ptr_const_string_procs;
|
|
|
130 |
#define ptr_const_string_type (&ptr_const_string_procs)
|
|
|
131 |
|
|
|
132 |
/*
|
|
|
133 |
* Define the type for a GC root.
|
|
|
134 |
*/
|
|
|
135 |
/*typedef struct gs_gc_root_s gs_gc_root_t;*/ /* in gsmemory.h */
|
|
|
136 |
struct gs_gc_root_s {
|
|
|
137 |
gs_gc_root_t *next;
|
|
|
138 |
gs_ptr_type_t ptype;
|
|
|
139 |
void **p;
|
|
|
140 |
bool free_on_unregister;
|
|
|
141 |
};
|
|
|
142 |
|
|
|
143 |
#define public_st_gc_root_t() /* in gsmemory.c */\
|
|
|
144 |
gs_public_st_ptrs1(st_gc_root_t, gs_gc_root_t, "gs_gc_root_t",\
|
|
|
145 |
gc_root_enum_ptrs, gc_root_reloc_ptrs, next)
|
|
|
146 |
|
|
|
147 |
/* Print a root debugging message. */
|
|
|
148 |
#define if_debug_root(c, msg, rp)\
|
|
|
149 |
if_debug4(c, "%s 0x%lx: 0x%lx -> 0x%lx\n",\
|
|
|
150 |
msg, (ulong)(rp), (ulong)(rp)->p, (ulong)*(rp)->p)
|
|
|
151 |
|
|
|
152 |
/*
|
|
|
153 |
* We don't want to tie the allocator to using a single garbage collector,
|
|
|
154 |
* so we pass all the relevant GC procedures in to the structure pointer
|
|
|
155 |
* enumeration and relocation procedures. The GC state must begin with
|
|
|
156 |
* a pointer to the following procedure vector.
|
|
|
157 |
*
|
|
|
158 |
* By default, this is all the procedures we know about, but there are
|
|
|
159 |
* additional procedures defined in the interpreter for dealing with
|
|
|
160 |
* 'ref' objects.
|
|
|
161 |
*/
|
|
|
162 |
#define string_proc_reloc(proc)\
|
|
|
163 |
void proc(gs_string *, gc_state_t *)
|
|
|
164 |
#define const_string_proc_reloc(proc)\
|
|
|
165 |
void proc(gs_const_string *, gc_state_t *)
|
|
|
166 |
#define param_string_proc_reloc(proc)\
|
|
|
167 |
void proc(gs_param_string *, gc_state_t *)
|
|
|
168 |
#define gc_procs_common\
|
|
|
169 |
/* Relocate a pointer to an object. */\
|
|
|
170 |
ptr_proc_reloc((*reloc_struct_ptr), void /*obj_header_t*/);\
|
|
|
171 |
/* Relocate a pointer to a string. */\
|
|
|
172 |
string_proc_reloc((*reloc_string));\
|
|
|
173 |
/* Relocate a pointer to a const string. */\
|
|
|
174 |
const_string_proc_reloc((*reloc_const_string));\
|
|
|
175 |
/* Relocate a pointer to a parameter string. */\
|
|
|
176 |
param_string_proc_reloc((*reloc_param_string))
|
|
|
177 |
typedef struct gc_procs_common_s {
|
|
|
178 |
gc_procs_common;
|
|
|
179 |
} gc_procs_common_t;
|
|
|
180 |
|
|
|
181 |
#define gc_proc(gcst, proc) ((*(const gc_procs_common_t **)(gcst))->proc)
|
|
|
182 |
|
|
|
183 |
/* Define the accessor for structure type names. */
|
|
|
184 |
#define struct_type_name_string(pstype) ((const char *)((pstype)->sname))
|
|
|
185 |
|
|
|
186 |
/* Default pointer processing */
|
|
|
187 |
struct_proc_enum_ptrs(gs_no_struct_enum_ptrs);
|
|
|
188 |
struct_proc_reloc_ptrs(gs_no_struct_reloc_ptrs);
|
|
|
189 |
|
|
|
190 |
/* Define 'type' descriptors for some standard objects. */
|
|
|
191 |
|
|
|
192 |
/* Free blocks */
|
|
|
193 |
|
|
|
194 |
extern_st(st_free);
|
|
|
195 |
|
|
|
196 |
/* Byte objects */
|
|
|
197 |
|
|
|
198 |
extern_st(st_bytes);
|
|
|
199 |
|
|
|
200 |
/* GC roots */
|
|
|
201 |
|
|
|
202 |
extern_st(st_gc_root_t);
|
|
|
203 |
|
|
|
204 |
/* Elements and arrays of const strings. */
|
|
|
205 |
|
|
|
206 |
#define private_st_const_string()\
|
|
|
207 |
BASIC_PTRS(const_string_elts) {\
|
|
|
208 |
{ GC_ELT_CONST_STRING, 0 }\
|
|
|
209 |
};\
|
|
|
210 |
gs__st_basic(private_st, st_const_string, gs_const_string,\
|
|
|
211 |
"gs_const_string", const_string_elts, const_string_sdata)
|
|
|
212 |
|
|
|
213 |
extern_st(st_const_string_element);
|
|
|
214 |
#define public_st_const_string_element()\
|
|
|
215 |
gs_public_st_element(st_const_string_element, gs_const_string,\
|
|
|
216 |
"gs_const_string[]", const_string_elt_enum_ptrs,\
|
|
|
217 |
const_string_elt_reloc_ptrs, st_const_string)
|
|
|
218 |
|
|
|
219 |
/* ================ Macros for defining structure types ================ */
|
|
|
220 |
|
|
|
221 |
#define public_st public const gs_memory_struct_type_t
|
|
|
222 |
#define private_st private const gs_memory_struct_type_t
|
|
|
223 |
|
|
|
224 |
/*
|
|
|
225 |
* As an alternative to defining different enum_ptrs and reloc_ptrs
|
|
|
226 |
* procedures for basic structure types that only have a fixed number of
|
|
|
227 |
* pointers and possibly a single supertype, we can define the type's GC
|
|
|
228 |
* information using stock procedures and a table. Each entry in the table
|
|
|
229 |
* defines one element of the structure.
|
|
|
230 |
*/
|
|
|
231 |
|
|
|
232 |
/* Define the pointer types of individual elements. */
|
|
|
233 |
|
|
|
234 |
typedef enum {
|
|
|
235 |
GC_ELT_OBJ, /* obj * or const obj * */
|
|
|
236 |
GC_ELT_STRING, /* gs_string */
|
|
|
237 |
GC_ELT_CONST_STRING /* gs_const_string */
|
|
|
238 |
} gc_ptr_type_index_t;
|
|
|
239 |
|
|
|
240 |
typedef struct gc_ptr_element_s {
|
|
|
241 |
ushort /*gc_ptr_type_index_t */ type;
|
|
|
242 |
ushort offset;
|
|
|
243 |
} gc_ptr_element_t;
|
|
|
244 |
|
|
|
245 |
#define GC_OBJ_ELT(typ, elt)\
|
|
|
246 |
{ GC_ELT_OBJ, offset_of(typ, elt) }
|
|
|
247 |
#define GC_OBJ_ELT2(typ, e1, e2)\
|
|
|
248 |
GC_OBJ_ELT(typ, e1), GC_OBJ_ELT(typ, e2)
|
|
|
249 |
#define GC_OBJ_ELT3(typ, e1, e2, e3)\
|
|
|
250 |
GC_OBJ_ELT(typ, e1), GC_OBJ_ELT(typ, e2), GC_OBJ_ELT(typ, e3)
|
|
|
251 |
#define GC_STRING_ELT(typ, elt)\
|
|
|
252 |
{ GC_ELT_STRING, offset_of(typ, elt) }
|
|
|
253 |
#define GC_CONST_STRING_ELT(typ, elt)\
|
|
|
254 |
{ GC_ELT_CONST_STRING, offset_of(typ, elt) }
|
|
|
255 |
|
|
|
256 |
/* Define the complete table of descriptor data. */
|
|
|
257 |
|
|
|
258 |
typedef struct gc_struct_data_s {
|
|
|
259 |
ushort num_ptrs;
|
|
|
260 |
ushort super_offset;
|
|
|
261 |
const gs_memory_struct_type_t *super_type; /* 0 if none */
|
|
|
262 |
const gc_ptr_element_t *ptrs;
|
|
|
263 |
} gc_struct_data_t;
|
|
|
264 |
|
|
|
265 |
/*
|
|
|
266 |
* Define the enum_ptrs and reloc_ptrs procedures, and the declaration
|
|
|
267 |
* macros, for table-specified structures. For such structures, the
|
|
|
268 |
* proc_data points to a gc_struct_data_t. The standard defining form
|
|
|
269 |
* is:
|
|
|
270 |
|
|
|
271 |
BASIC_PTRS(xxx_ptrs) {
|
|
|
272 |
... elements ...
|
|
|
273 |
};
|
|
|
274 |
gs_(private|public)_st_basic_super_final(stname, stype, sname, xxx_ptrs,
|
|
|
275 |
xxx_data, supst, supoff, pfinal);
|
|
|
276 |
gs_(private|public)_st_basic_super(stname, stype, sname, xxx_ptrs, xxx_data,
|
|
|
277 |
supst, supoff);
|
|
|
278 |
gs_(private|public)_st_basic(stname, stype, sname, xxx_ptrs, xxx_data);
|
|
|
279 |
|
|
|
280 |
*/
|
|
|
281 |
struct_proc_enum_ptrs(basic_enum_ptrs);
|
|
|
282 |
struct_proc_reloc_ptrs(basic_reloc_ptrs);
|
|
|
283 |
|
|
|
284 |
#define BASIC_PTRS(elts)\
|
|
|
285 |
private const gc_ptr_element_t elts[] =
|
|
|
286 |
#define gs__st_basic_with_super_final(scope_st, stname, stype, sname, nelts, elts, sdata, supst, supoff, pfinal)\
|
|
|
287 |
private const gc_struct_data_t sdata = {\
|
|
|
288 |
nelts, supoff, supst, elts\
|
|
|
289 |
};\
|
|
|
290 |
scope_st stname = {\
|
|
|
291 |
sizeof(stype), sname, 0, 0, basic_enum_ptrs, basic_reloc_ptrs,\
|
|
|
292 |
pfinal, &sdata\
|
|
|
293 |
}
|
|
|
294 |
/* Basic objects with superclass and finalization. */
|
|
|
295 |
#define gs__st_basic_super_final(scope_st, stname, stype, sname, elts, sdata, supst, supoff, pfinal)\
|
|
|
296 |
gs__st_basic_with_super_final(scope_st, stname, stype, sname, countof(elts), elts, sdata, supst, supoff, pfinal)
|
|
|
297 |
#define gs_public_st_basic_super_final(stname, stype, sname, elts, sdata, supst, supoff, pfinal)\
|
|
|
298 |
gs__st_basic_super_final(public_st, stname, stype, sname, elts, sdata, supst, supoff, pfinal)
|
|
|
299 |
#define gs_private_st_basic_super_final(stname, stype, sname, elts, sdata, supst, supoff, pfinal)\
|
|
|
300 |
gs__st_basic_super_final(private_st, stname, stype, sname, elts, sdata, supst, supoff, pfinal)
|
|
|
301 |
/* Basic objects with only superclass. */
|
|
|
302 |
#define gs__st_basic_super(scope_st, stname, stype, sname, elts, sdata, supst, supoff)\
|
|
|
303 |
gs__st_basic_super_final(scope_st, stname, stype, sname, elts, sdata, supst, supoff, 0)
|
|
|
304 |
#define gs_public_st_basic_super(stname, stype, sname, elts, sdata, supst, supoff)\
|
|
|
305 |
gs__st_basic_super(public_st, stname, stype, sname, elts, sdata, supst, supoff)
|
|
|
306 |
#define gs_private_st_basic_super(stname, stype, sname, elts, sdata, supst, supoff)\
|
|
|
307 |
gs__st_basic_super(private_st, stname, stype, sname, elts, sdata, supst, supoff)
|
|
|
308 |
/* Basic objects with no frills. */
|
|
|
309 |
#define gs__st_basic(scope_st, stname, stype, sname, elts, sdata)\
|
|
|
310 |
gs__st_basic_super(scope_st, stname, stype, sname, elts, sdata, 0, 0)
|
|
|
311 |
#define gs_public_st_basic(stname, stype, sname, elts, sdata)\
|
|
|
312 |
gs__st_basic(public_st, stname, stype, sname, elts, sdata)
|
|
|
313 |
#define gs_private_st_basic(stname, stype, sname, elts, sdata)\
|
|
|
314 |
gs__st_basic(private_st, stname, stype, sname, elts, sdata)
|
|
|
315 |
|
|
|
316 |
/*
|
|
|
317 |
* The simplest kind of composite structure is one with a fixed set of
|
|
|
318 |
* pointers, each of which points to a struct. We provide macros for
|
|
|
319 |
* defining this kind of structure conveniently, either all at once in
|
|
|
320 |
* the structure definition macro, or using the following template:
|
|
|
321 |
|
|
|
322 |
ENUM_PTRS_WITH(xxx_enum_ptrs, stype *const myptr) return 0;
|
|
|
323 |
... ENUM_PTR(i, xxx, elt); ...
|
|
|
324 |
ENUM_PTRS_END
|
|
|
325 |
RELOC_PTRS_WITH(xxx_reloc_ptrs, stype *const myptr)
|
|
|
326 |
{
|
|
|
327 |
...
|
|
|
328 |
RELOC_VAR(myptr->elt);
|
|
|
329 |
...
|
|
|
330 |
}
|
|
|
331 |
|
|
|
332 |
*/
|
|
|
333 |
/*
|
|
|
334 |
* We have to pull the 'private' outside the ENUM_PTRS_BEGIN and
|
|
|
335 |
* RELOC_PTRS_BEGIN macros because of a bug in the Borland C++ preprocessor.
|
|
|
336 |
* We also have to make sure there is more on the line after these
|
|
|
337 |
* macros, so as not to confuse ansi2knr.
|
|
|
338 |
*/
|
|
|
339 |
|
|
|
340 |
/* Begin enumeration */
|
|
|
341 |
|
|
|
342 |
#define ENUM_PTRS_BEGIN_PROC(proc)\
|
|
|
343 |
gs_ptr_type_t proc(const gs_memory_t *mem, EV_CONST void *vptr, uint size, int index, enum_ptr_t *pep, const gs_memory_struct_type_t *pstype, gc_state_t *gcst)
|
|
|
344 |
#define ENUM_PTRS_BEGIN(proc)\
|
|
|
345 |
ENUM_PTRS_BEGIN_PROC(proc)\
|
|
|
346 |
{ switch ( index ) { default:
|
|
|
347 |
#define ENUM_PTRS_WITH(proc, stype_ptr)\
|
|
|
348 |
ENUM_PTRS_BEGIN_PROC(proc)\
|
|
|
349 |
{ EV_CONST stype_ptr = vptr; switch ( index ) { default:
|
|
|
350 |
|
|
|
351 |
/* Enumerate elements */
|
|
|
352 |
|
|
|
353 |
#define ENUM_OBJ(optr) /* pointer to object */\
|
|
|
354 |
(pep->ptr = (const void *)(optr), ptr_struct_type)
|
|
|
355 |
#define ENUM_STRING2(sdata, ssize) /* gs_string */\
|
|
|
356 |
(pep->ptr = sdata, pep->size = ssize, ptr_string_type)
|
|
|
357 |
#define ENUM_STRING(sptr) /* pointer to gs_string */\
|
|
|
358 |
ENUM_STRING2((sptr)->data, (sptr)->size)
|
|
|
359 |
#define ENUM_CONST_STRING2(sdata, ssize) /* gs_const_string */\
|
|
|
360 |
(pep->ptr = sdata, pep->size = ssize, ptr_const_string_type)
|
|
|
361 |
#define ENUM_CONST_STRING(sptr) /* pointer to gs_const_string */\
|
|
|
362 |
ENUM_CONST_STRING2((sptr)->data, (sptr)->size)
|
|
|
363 |
extern gs_ptr_type_t
|
|
|
364 |
enum_bytestring(enum_ptr_t *pep, const gs_bytestring *pbs);
|
|
|
365 |
#define ENUM_BYTESTRING(ptr) /* pointer to gs_bytestring */\
|
|
|
366 |
enum_bytestring(pep, ptr)
|
|
|
367 |
extern gs_ptr_type_t
|
|
|
368 |
enum_const_bytestring(enum_ptr_t *pep, const gs_const_bytestring *pbs);
|
|
|
369 |
#define ENUM_CONST_BYTESTRING(ptr) /* pointer to gs_const_bytestring */\
|
|
|
370 |
enum_const_bytestring(pep, ptr)
|
|
|
371 |
|
|
|
372 |
#define ENUM_OBJ_ELT(typ, elt)\
|
|
|
373 |
ENUM_OBJ(((const typ *)vptr)->elt)
|
|
|
374 |
#define ENUM_STRING_ELT(typ, elt)\
|
|
|
375 |
ENUM_STRING(&((const typ *)vptr)->elt)
|
|
|
376 |
#define ENUM_PARAM_STRING_ELT(typ, elt)\
|
|
|
377 |
(((const typ *)vptr)->elt.persistent ? 0 : ENUM_STRING(&((const typ *)vptr)->elt))
|
|
|
378 |
#define ENUM_CONST_STRING_ELT(typ, elt)\
|
|
|
379 |
ENUM_CONST_STRING(&((const typ *)vptr)->elt)
|
|
|
380 |
|
|
|
381 |
#define ENUM_PTR(i, typ, elt)\
|
|
|
382 |
case i: return ENUM_OBJ_ELT(typ, elt)
|
|
|
383 |
#define ENUM_PTR2(i, typ, e1, e2) /* just an abbreviation */\
|
|
|
384 |
ENUM_PTR(i, typ, e1); ENUM_PTR((i)+1, typ, e2)
|
|
|
385 |
#define ENUM_PTR3(i, typ, e1, e2, e3) /* just an abbreviation */\
|
|
|
386 |
ENUM_PTR(i, typ, e1); ENUM_PTR((i)+1, typ, e2); ENUM_PTR((i)+2, typ, e3)
|
|
|
387 |
#define ENUM_STRING_PTR(i, typ, elt)\
|
|
|
388 |
case i: return ENUM_STRING_ELT(typ, elt)
|
|
|
389 |
#define ENUM_PARAM_STRING_PTR(i, typ, elt)\
|
|
|
390 |
case i: return ENUM_PARAM_STRING_ELT(typ, elt)
|
|
|
391 |
#define ENUM_CONST_STRING_PTR(i, typ, elt)\
|
|
|
392 |
case i: return ENUM_CONST_STRING_ELT(typ, elt)
|
|
|
393 |
|
|
|
394 |
/* End enumeration */
|
|
|
395 |
|
|
|
396 |
#define ENUM_PTRS_END\
|
|
|
397 |
} /* mustn't fall through! */ ENUM_PTRS_END_PROC }
|
|
|
398 |
#define ENUM_PTRS_END_PROC /* */
|
|
|
399 |
|
|
|
400 |
/* Begin relocation */
|
|
|
401 |
|
|
|
402 |
#define RELOC_PTRS_BEGIN(proc)\
|
|
|
403 |
void proc(void *vptr, uint size, const gs_memory_struct_type_t *pstype, gc_state_t *gcst) {
|
|
|
404 |
#define RELOC_PTRS_WITH(proc, stype_ptr)\
|
|
|
405 |
RELOC_PTRS_BEGIN(proc) stype_ptr = vptr;
|
|
|
406 |
|
|
|
407 |
/* Relocate elements */
|
|
|
408 |
|
|
|
409 |
#define RELOC_OBJ(ptr)\
|
|
|
410 |
(gc_proc(gcst, reloc_struct_ptr)((const void *)(ptr), gcst))
|
|
|
411 |
#define RELOC_OBJ_VAR(ptrvar)\
|
|
|
412 |
(ptrvar = RELOC_OBJ(ptrvar))
|
|
|
413 |
#define RELOC_VAR(ptrvar) /* a handy abbreviation */\
|
|
|
414 |
RELOC_OBJ_VAR(ptrvar)
|
|
|
415 |
#define RELOC_STRING_VAR(ptrvar)\
|
|
|
416 |
(gc_proc(gcst, reloc_string)(&(ptrvar), gcst))
|
|
|
417 |
#define RELOC_CONST_STRING_VAR(ptrvar)\
|
|
|
418 |
(gc_proc(gcst, reloc_const_string)(&(ptrvar), gcst))
|
|
|
419 |
#define RELOC_PARAM_STRING_VAR(ptrvar)\
|
|
|
420 |
(gc_proc(gcst, reloc_param_string)(&(ptrvar), gcst))
|
|
|
421 |
extern void reloc_bytestring(gs_bytestring *pbs, gc_state_t *gcst);
|
|
|
422 |
#define RELOC_BYTESTRING_VAR(ptrvar)\
|
|
|
423 |
reloc_bytestring(&(ptrvar), gcst)
|
|
|
424 |
extern void reloc_const_bytestring(gs_const_bytestring *pbs, gc_state_t *gcst);
|
|
|
425 |
#define RELOC_CONST_BYTESTRING_VAR(ptrvar)\
|
|
|
426 |
reloc_const_bytestring(&(ptrvar), gcst)
|
|
|
427 |
|
|
|
428 |
#define RELOC_OBJ_ELT(typ, elt)\
|
|
|
429 |
RELOC_VAR(((typ *)vptr)->elt)
|
|
|
430 |
#define RELOC_STRING_ELT(typ, elt)\
|
|
|
431 |
RELOC_STRING_VAR(((typ *)vptr)->elt)
|
|
|
432 |
#define RELOC_CONST_STRING_ELT(typ, elt)\
|
|
|
433 |
RELOC_CONST_STRING_VAR(((typ *)vptr)->elt)
|
|
|
434 |
#define RELOC_PARAM_STRING_ELT(typ, elt)\
|
|
|
435 |
RELOC_PARAM_STRING_VAR(((typ *)vptr)->elt)
|
|
|
436 |
|
|
|
437 |
/* Relocate a pointer that points to a known offset within an object. */
|
|
|
438 |
/* OFFSET is for byte offsets, TYPED_OFFSET is for element offsets. */
|
|
|
439 |
#define RELOC_OFFSET_ELT(typ, elt, offset)\
|
|
|
440 |
((typ *)vptr)->elt = (void *)\
|
|
|
441 |
((char *)RELOC_OBJ((char *)((typ *)vptr)->elt - (offset)) +\
|
|
|
442 |
(offset))
|
|
|
443 |
#define RELOC_TYPED_OFFSET_ELT(typ, elt, offset)\
|
|
|
444 |
(((typ *)vptr)->elt = (void *)RELOC_OBJ(((typ *)vptr)->elt - (offset)),\
|
|
|
445 |
((typ *)vptr)->elt += (offset))
|
|
|
446 |
|
|
|
447 |
/* Backward compatibility */
|
|
|
448 |
|
|
|
449 |
#define RELOC_PTR(typ, elt)\
|
|
|
450 |
RELOC_OBJ_ELT(typ, elt)
|
|
|
451 |
#define RELOC_PTR2(typ, e1, e2) /* just an abbreviation */\
|
|
|
452 |
RELOC_PTR(typ,e1); RELOC_PTR(typ,e2)
|
|
|
453 |
#define RELOC_PTR3(typ, e1, e2, e3) /* just an abbreviation */\
|
|
|
454 |
RELOC_PTR(typ,e1); RELOC_PTR(typ,e2); RELOC_PTR(typ,e3)
|
|
|
455 |
#define RELOC_OFFSET_PTR(typ, elt, offset)\
|
|
|
456 |
RELOC_OFFSET_ELT(typ, elt, offset)
|
|
|
457 |
#define RELOC_TYPED_OFFSET_PTR(typ, elt, offset)\
|
|
|
458 |
RELOC_TYPED_OFFSET_ELT(typ, elt, offset)
|
|
|
459 |
#define RELOC_STRING_PTR(typ, elt)\
|
|
|
460 |
RELOC_STRING_ELT(typ, elt)
|
|
|
461 |
#define RELOC_CONST_STRING_PTR(typ, elt)\
|
|
|
462 |
RELOC_CONST_STRING_ELT(typ, elt)
|
|
|
463 |
#define RELOC_PARAM_STRING_PTR(typ, elt)\
|
|
|
464 |
RELOC_PARAM_STRING_ELT(typ, elt)
|
|
|
465 |
|
|
|
466 |
/* End relocation */
|
|
|
467 |
|
|
|
468 |
#define RELOC_PTRS_END\
|
|
|
469 |
}
|
|
|
470 |
|
|
|
471 |
/* Subclass support */
|
|
|
472 |
|
|
|
473 |
#define ENUM_USING(supst, ptr, size, index)\
|
|
|
474 |
(*(supst).enum_ptrs)(mem, ptr, size, index, pep, &(supst), gcst)
|
|
|
475 |
|
|
|
476 |
#define RELOC_USING(supst, ptr, size)\
|
|
|
477 |
(*(supst).reloc_ptrs)(ptr, size, &(supst), gcst)
|
|
|
478 |
|
|
|
479 |
/*
|
|
|
480 |
* Support for suffix subclasses. Special subclasses constructed
|
|
|
481 |
* 'by hand' may use this also.
|
|
|
482 |
*/
|
|
|
483 |
|
|
|
484 |
#define ENUM_USING_PREFIX(supst, n)\
|
|
|
485 |
ENUM_USING(supst, vptr, size, index-(n))
|
|
|
486 |
|
|
|
487 |
#define ENUM_PREFIX(supst, n)\
|
|
|
488 |
return ENUM_USING_PREFIX(supst, n)
|
|
|
489 |
|
|
|
490 |
#define RELOC_PREFIX(supst)\
|
|
|
491 |
RELOC_USING(supst, vptr, size)
|
|
|
492 |
|
|
|
493 |
/*
|
|
|
494 |
* Support for general subclasses.
|
|
|
495 |
*/
|
|
|
496 |
|
|
|
497 |
#define ENUM_SUPER_ELT(stype, supst, member, n)\
|
|
|
498 |
ENUM_USING(supst, &((EV_CONST stype *)vptr)->member, sizeof(((EV_CONST stype *)vptr)->member), index-(n))
|
|
|
499 |
#define ENUM_SUPER(stype, supst, member, n)\
|
|
|
500 |
return ENUM_SUPER_ELT(stype, supst, member, n)
|
|
|
501 |
|
|
|
502 |
#define RELOC_SUPER_ELT(stype, supst, member)\
|
|
|
503 |
RELOC_USING(supst, &((stype *)vptr)->member, sizeof(((stype *)vptr)->member))
|
|
|
504 |
#define RELOC_SUPER(stype, supst, member)\
|
|
|
505 |
RELOC_SUPER_ELT(stype, supst, member)
|
|
|
506 |
|
|
|
507 |
/* Backward compatibility. */
|
|
|
508 |
|
|
|
509 |
#define ENUM_RETURN(ptr) return ENUM_OBJ(ptr)
|
|
|
510 |
#define ENUM_RETURN_PTR(typ, elt) return ENUM_OBJ_ELT(typ, elt)
|
|
|
511 |
#define ENUM_RETURN_STRING_PTR(typ, elt) return ENUM_STRING_ELT(typ, elt)
|
|
|
512 |
#define ENUM_RETURN_CONST_STRING(ptr) return ENUM_CONST_STRING(ptr)
|
|
|
513 |
#define ENUM_RETURN_CONST_STRING_PTR(typ, elt) return ENUM_CONST_STRING_ELT(typ, elt)
|
|
|
514 |
|
|
|
515 |
/* -------------- Simple structures (no internal pointers). -------------- */
|
|
|
516 |
|
|
|
517 |
#define gs__st_simple(scope_st, stname, stype, sname)\
|
|
|
518 |
scope_st stname = { sizeof(stype), sname, 0, 0, gs_no_struct_enum_ptrs, gs_no_struct_reloc_ptrs, 0 }
|
|
|
519 |
#define gs_public_st_simple(stname, stype, sname)\
|
|
|
520 |
gs__st_simple(public_st, stname, stype, sname)
|
|
|
521 |
#define gs_private_st_simple(stname, stype, sname)\
|
|
|
522 |
gs__st_simple(private_st, stname, stype, sname)
|
|
|
523 |
|
|
|
524 |
#define gs__st_simple_final(scope_st, stname, stype, sname, pfinal)\
|
|
|
525 |
scope_st stname = { sizeof(stype), sname, 0, 0, gs_no_struct_enum_ptrs, gs_no_struct_reloc_ptrs, pfinal }
|
|
|
526 |
#define gs_public_st_simple_final(stname, stype, sname, pfinal)\
|
|
|
527 |
gs__st_simple_final(public_st, stname, stype, sname, pfinal)
|
|
|
528 |
#define gs_private_st_simple_final(stname, stype, sname, pfinal)\
|
|
|
529 |
gs__st_simple_final(private_st, stname, stype, sname, pfinal)
|
|
|
530 |
|
|
|
531 |
/* ---------------- Structures with explicit procedures. ---------------- */
|
|
|
532 |
|
|
|
533 |
/*
|
|
|
534 |
* Boilerplate for clear_marks procedures.
|
|
|
535 |
*/
|
|
|
536 |
#define CLEAR_MARKS_PROC(proc)\
|
|
|
537 |
void proc(const gs_memory_t *cmem, void *vptr, uint size, const gs_memory_struct_type_t *pstype)
|
|
|
538 |
|
|
|
539 |
/* Complex structures with their own clear_marks, */
|
|
|
540 |
/* enum, reloc, and finalize procedures. */
|
|
|
541 |
|
|
|
542 |
#define gs__st_complex_only(scope_st, stname, stype, sname, pclear, penum, preloc, pfinal)\
|
|
|
543 |
scope_st stname = { sizeof(stype), sname, 0, pclear, penum, preloc, pfinal }
|
|
|
544 |
#define gs_public_st_complex_only(stname, stype, sname, pclear, penum, preloc, pfinal)\
|
|
|
545 |
gs__st_complex_only(public_st, stname, stype, sname, pclear, penum, preloc, pfinal)
|
|
|
546 |
#define gs_private_st_complex_only(stname, stype, sname, pclear, penum, preloc, pfinal)\
|
|
|
547 |
gs__st_complex_only(private_st, stname, stype, sname, pclear, penum, preloc, pfinal)
|
|
|
548 |
|
|
|
549 |
#define gs__st_complex(scope_st, stname, stype, sname, pclear, penum, preloc, pfinal)\
|
|
|
550 |
private struct_proc_clear_marks(pclear);\
|
|
|
551 |
private struct_proc_enum_ptrs(penum);\
|
|
|
552 |
private struct_proc_reloc_ptrs(preloc);\
|
|
|
553 |
private struct_proc_finalize(pfinal);\
|
|
|
554 |
gs__st_complex_only(scope_st, stname, stype, sname, pclear, penum, preloc, pfinal)
|
|
|
555 |
#define gs_public_st_complex(stname, stype, sname, pclear, penum, preloc, pfinal)\
|
|
|
556 |
gs__st_complex(public_st, stname, stype, sname, pclear, penum, preloc, pfinal)
|
|
|
557 |
#define gs_private_st_complex(stname, stype, sname, pclear, penum, preloc, pfinal)\
|
|
|
558 |
gs__st_complex(private_st, stname, stype, sname, pclear, penum, preloc, pfinal)
|
|
|
559 |
|
|
|
560 |
/* Composite structures with their own enum and reloc procedures. */
|
|
|
561 |
|
|
|
562 |
#define gs__st_composite(scope_st, stname, stype, sname, penum, preloc)\
|
|
|
563 |
private struct_proc_enum_ptrs(penum);\
|
|
|
564 |
private struct_proc_reloc_ptrs(preloc);\
|
|
|
565 |
gs__st_complex_only(scope_st, stname, stype, sname, 0, penum, preloc, 0)
|
|
|
566 |
#define gs_public_st_composite(stname, stype, sname, penum, preloc)\
|
|
|
567 |
gs__st_composite(public_st, stname, stype, sname, penum, preloc)
|
|
|
568 |
#define gs_private_st_composite(stname, stype, sname, penum, preloc)\
|
|
|
569 |
gs__st_composite(private_st, stname, stype, sname, penum, preloc)
|
|
|
570 |
|
|
|
571 |
/* Composite structures with inherited finalization. */
|
|
|
572 |
|
|
|
573 |
#define gs__st_composite_use_final(scope_st, stname, stype, sname, penum, preloc, pfinal)\
|
|
|
574 |
private struct_proc_enum_ptrs(penum);\
|
|
|
575 |
private struct_proc_reloc_ptrs(preloc);\
|
|
|
576 |
gs__st_complex_only(scope_st, stname, stype, sname, 0, penum, preloc, pfinal)
|
|
|
577 |
#define gs_public_st_composite_use_final(stname, stype, sname, penum, preloc, pfinal)\
|
|
|
578 |
gs__st_composite_use_final(public_st, stname, stype, sname, penum, preloc, pfinal)
|
|
|
579 |
#define gs_private_st_composite_use_final(stname, stype, sname, penum, preloc, pfinal)\
|
|
|
580 |
gs__st_composite_use_final(private_st, stname, stype, sname, penum, preloc, pfinal)
|
|
|
581 |
|
|
|
582 |
/* Composite structures with finalization. */
|
|
|
583 |
|
|
|
584 |
#define gs__st_composite_final(scope_st, stname, stype, sname, penum, preloc, pfinal)\
|
|
|
585 |
private struct_proc_finalize(pfinal);\
|
|
|
586 |
gs__st_composite_use_final(scope_st, stname, stype, sname, penum, preloc, pfinal)
|
|
|
587 |
#define gs_public_st_composite_final(stname, stype, sname, penum, preloc, pfinal)\
|
|
|
588 |
gs__st_composite_final(public_st, stname, stype, sname, penum, preloc, pfinal)
|
|
|
589 |
#define gs_private_st_composite_final(stname, stype, sname, penum, preloc, pfinal)\
|
|
|
590 |
gs__st_composite_final(private_st, stname, stype, sname, penum, preloc, pfinal)
|
|
|
591 |
|
|
|
592 |
/* Composite structures with enum and reloc procedures */
|
|
|
593 |
/* already declared. */
|
|
|
594 |
|
|
|
595 |
#define gs__st_composite_only(scope_st, stname, stype, sname, penum, preloc)\
|
|
|
596 |
gs__st_complex_only(scope_st, stname, stype, sname, 0, penum, preloc, 0)
|
|
|
597 |
#define gs_public_st_composite_only(stname, stype, sname, penum, preloc)\
|
|
|
598 |
gs__st_composite_only(public_st, stname, stype, sname, penum, preloc)
|
|
|
599 |
#define gs_private_st_composite_only(stname, stype, sname, penum, preloc)\
|
|
|
600 |
gs__st_composite_only(private_st, stname, stype, sname, penum, preloc)
|
|
|
601 |
|
|
|
602 |
/* ---------------- Special kinds of structures ---------------- */
|
|
|
603 |
|
|
|
604 |
/* Element structures, for use in arrays of structures. */
|
|
|
605 |
/* Note that these require that the underlying structure's */
|
|
|
606 |
/* enum_ptrs procedure always return the same number of pointers. */
|
|
|
607 |
|
|
|
608 |
#define gs__st_element(scope_st, stname, stype, sname, penum, preloc, basest)\
|
|
|
609 |
private ENUM_PTRS_BEGIN_PROC(penum) {\
|
|
|
610 |
uint count = size / (uint)sizeof(stype);\
|
|
|
611 |
if ( count == 0 ) return 0;\
|
|
|
612 |
return ENUM_USING(basest, (EV_CONST char *)vptr + (index % count) * sizeof(stype),\
|
|
|
613 |
sizeof(stype), index / count);\
|
|
|
614 |
} ENUM_PTRS_END_PROC\
|
|
|
615 |
private RELOC_PTRS_BEGIN(preloc) {\
|
|
|
616 |
uint count = size / (uint)sizeof(stype);\
|
|
|
617 |
for ( ; count; count--, vptr = (char *)vptr + sizeof(stype) )\
|
|
|
618 |
RELOC_USING(basest, vptr, sizeof(stype));\
|
|
|
619 |
} RELOC_PTRS_END\
|
|
|
620 |
gs__st_composite_only(scope_st, stname, stype, sname, penum, preloc)
|
|
|
621 |
#define gs_public_st_element(stname, stype, sname, penum, preloc, basest)\
|
|
|
622 |
gs__st_element(public_st, stname, stype, sname, penum, preloc, basest)
|
|
|
623 |
#define gs_private_st_element(stname, stype, sname, penum, preloc, basest)\
|
|
|
624 |
gs__st_element(private_st, stname, stype, sname, penum, preloc, basest)
|
|
|
625 |
|
|
|
626 |
/* A "structure" just consisting of a pointer. */
|
|
|
627 |
/* Note that in this case only, stype is a pointer type. */
|
|
|
628 |
/* Fortunately, C's bizarre 'const' syntax does what we want here. */
|
|
|
629 |
|
|
|
630 |
#define gs__st_ptr(scope_st, stname, stype, sname, penum, preloc)\
|
|
|
631 |
private ENUM_PTRS_BEGIN(penum) return 0;\
|
|
|
632 |
case 0: return ENUM_OBJ(*(stype const *)vptr);\
|
|
|
633 |
ENUM_PTRS_END\
|
|
|
634 |
private RELOC_PTRS_BEGIN(preloc) ;\
|
|
|
635 |
RELOC_VAR(*(stype *)vptr);\
|
|
|
636 |
RELOC_PTRS_END\
|
|
|
637 |
gs__st_composite_only(scope_st, stname, stype, sname, penum, preloc)
|
|
|
638 |
#define gs_public_st_ptr(stname, stype, sname, penum, preloc)\
|
|
|
639 |
gs__st_ptr(public_st, stname, stype, sname, penum, preloc)
|
|
|
640 |
#define gs_private_st_ptr(stname, stype, sname, penum, preloc)\
|
|
|
641 |
gs__st_ptr(private_st, stname, stype, sname, penum, preloc)
|
|
|
642 |
|
|
|
643 |
/* ---------- Ordinary structures with a fixed set of pointers ----------- */
|
|
|
644 |
/* Note that we "cannibalize" the penum and preloc names for elts and sdata. */
|
|
|
645 |
|
|
|
646 |
/* Structures with 1 pointer. */
|
|
|
647 |
|
|
|
648 |
#define gs__st_ptrs1(scope_st, stname, stype, sname, penum, preloc, e1)\
|
|
|
649 |
BASIC_PTRS(penum) {\
|
|
|
650 |
GC_OBJ_ELT(stype, e1)\
|
|
|
651 |
};\
|
|
|
652 |
gs__st_basic(scope_st, stname, stype, sname, penum, preloc)
|
|
|
653 |
#define gs_public_st_ptrs1(stname, stype, sname, penum, preloc, e1)\
|
|
|
654 |
gs__st_ptrs1(public_st, stname, stype, sname, penum, preloc, e1)
|
|
|
655 |
#define gs_private_st_ptrs1(stname, stype, sname, penum, preloc, e1)\
|
|
|
656 |
gs__st_ptrs1(private_st, stname, stype, sname, penum, preloc, e1)
|
|
|
657 |
|
|
|
658 |
/* Structures with 1 string. */
|
|
|
659 |
|
|
|
660 |
#define gs__st_strings1(scope_st, stname, stype, sname, penum, preloc, e1)\
|
|
|
661 |
BASIC_PTRS(penum) {\
|
|
|
662 |
GC_STRING_ELT(stype, e1)\
|
|
|
663 |
};\
|
|
|
664 |
gs__st_basic(scope_st, stname, stype, sname, penum, preloc)
|
|
|
665 |
#define gs_public_st_strings1(stname, stype, sname, penum, preloc, e1)\
|
|
|
666 |
gs__st_strings1(public_st, stname, stype, sname, penum, preloc, e1)
|
|
|
667 |
#define gs_private_st_strings1(stname, stype, sname, penum, preloc, e1)\
|
|
|
668 |
gs__st_strings1(private_st, stname, stype, sname, penum, preloc, e1)
|
|
|
669 |
|
|
|
670 |
/* Structures with 1 const string. */
|
|
|
671 |
|
|
|
672 |
#define gs__st_const_strings1(scope_st, stname, stype, sname, penum, preloc, e1)\
|
|
|
673 |
BASIC_PTRS(penum) {\
|
|
|
674 |
GC_CONST_STRING_ELT(stype, e1)\
|
|
|
675 |
};\
|
|
|
676 |
gs__st_basic(scope_st, stname, stype, sname, penum, preloc)
|
|
|
677 |
#define gs_public_st_const_strings1(stname, stype, sname, penum, preloc, e1)\
|
|
|
678 |
gs__st_const_strings1(public_st, stname, stype, sname, penum, preloc, e1)
|
|
|
679 |
#define gs_private_st_const_strings1(stname, stype, sname, penum, preloc, e1)\
|
|
|
680 |
gs__st_const_strings1(private_st, stname, stype, sname, penum, preloc, e1)
|
|
|
681 |
|
|
|
682 |
/* Structures with 1 const string and 1 pointer. */
|
|
|
683 |
|
|
|
684 |
#define gs__st_const_strings1_ptrs1(scope_st, stname, stype, sname, penum, preloc, e1, e2)\
|
|
|
685 |
BASIC_PTRS(penum) {\
|
|
|
686 |
GC_CONST_STRING_ELT(stype, e1), GC_OBJ_ELT(stype, e2)\
|
|
|
687 |
};\
|
|
|
688 |
gs__st_basic(scope_st, stname, stype, sname, penum, preloc)
|
|
|
689 |
#define gs_public_st_const_strings1_ptrs1(stname, stype, sname, penum, preloc, e1, e2)\
|
|
|
690 |
gs__st_const_strings1_ptrs1(public_st, stname, stype, sname, penum, preloc, e1, e2)
|
|
|
691 |
#define gs_private_st_const_strings1_ptrs1(stname, stype, sname, penum, preloc, e1, e2)\
|
|
|
692 |
gs__st_const_strings1_ptrs1(private_st, stname, stype, sname, penum, preloc, e1, e2)
|
|
|
693 |
|
|
|
694 |
/* Structures with 2 const strings. */
|
|
|
695 |
|
|
|
696 |
#define gs__st_const_strings2(scope_st, stname, stype, sname, penum, preloc, e1, e2)\
|
|
|
697 |
BASIC_PTRS(penum) {\
|
|
|
698 |
GC_CONST_STRING_ELT(stype, e1), GC_CONST_STRING_ELT(stype, e2)\
|
|
|
699 |
};\
|
|
|
700 |
gs__st_basic(scope_st, stname, stype, sname, penum, preloc)
|
|
|
701 |
#define gs_public_st_const_strings2(stname, stype, sname, penum, preloc, e1, e2)\
|
|
|
702 |
gs__st_const_strings2(public_st, stname, stype, sname, penum, preloc, e1, e2)
|
|
|
703 |
#define gs_private_st_const_strings2(stname, stype, sname, penum, preloc, e1, e2)\
|
|
|
704 |
gs__st_const_strings2(private_st, stname, stype, sname, penum, preloc, e1, e2)
|
|
|
705 |
|
|
|
706 |
/* Structures with 2 pointers. */
|
|
|
707 |
|
|
|
708 |
#define gs__st_ptrs2(scope_st, stname, stype, sname, penum, preloc, e1, e2)\
|
|
|
709 |
BASIC_PTRS(penum) {\
|
|
|
710 |
GC_OBJ_ELT2(stype, e1, e2)\
|
|
|
711 |
};\
|
|
|
712 |
gs__st_basic(scope_st, stname, stype, sname, penum, preloc)
|
|
|
713 |
#define gs_public_st_ptrs2(stname, stype, sname, penum, preloc, e1, e2)\
|
|
|
714 |
gs__st_ptrs2(public_st, stname, stype, sname, penum, preloc, e1, e2)
|
|
|
715 |
#define gs_private_st_ptrs2(stname, stype, sname, penum, preloc, e1, e2)\
|
|
|
716 |
gs__st_ptrs2(private_st, stname, stype, sname, penum, preloc, e1, e2)
|
|
|
717 |
|
|
|
718 |
/* Structures with 3 pointers. */
|
|
|
719 |
|
|
|
720 |
#define gs__st_ptrs3(scope_st, stname, stype, sname, penum, preloc, e1, e2, e3)\
|
|
|
721 |
BASIC_PTRS(penum) {\
|
|
|
722 |
GC_OBJ_ELT3(stype, e1, e2, e3)\
|
|
|
723 |
};\
|
|
|
724 |
gs__st_basic(scope_st, stname, stype, sname, penum, preloc)
|
|
|
725 |
#define gs_public_st_ptrs3(stname, stype, sname, penum, preloc, e1, e2, e3)\
|
|
|
726 |
gs__st_ptrs3(public_st, stname, stype, sname, penum, preloc, e1, e2, e3)
|
|
|
727 |
#define gs_private_st_ptrs3(stname, stype, sname, penum, preloc, e1, e2, e3)\
|
|
|
728 |
gs__st_ptrs3(private_st, stname, stype, sname, penum, preloc, e1, e2, e3)
|
|
|
729 |
|
|
|
730 |
/* Structures with 4 pointers. */
|
|
|
731 |
|
|
|
732 |
#define gs__st_ptrs4(scope_st, stname, stype, sname, penum, preloc, e1, e2, e3, e4)\
|
|
|
733 |
BASIC_PTRS(penum) {\
|
|
|
734 |
GC_OBJ_ELT3(stype, e1, e2, e3), GC_OBJ_ELT(stype, e4)\
|
|
|
735 |
};\
|
|
|
736 |
gs__st_basic(scope_st, stname, stype, sname, penum, preloc)
|
|
|
737 |
#define gs_public_st_ptrs4(stname, stype, sname, penum, preloc, e1, e2, e3, e4)\
|
|
|
738 |
gs__st_ptrs4(public_st, stname, stype, sname, penum, preloc, e1, e2, e3, e4)
|
|
|
739 |
#define gs_private_st_ptrs4(stname, stype, sname, penum, preloc, e1, e2, e3, e4)\
|
|
|
740 |
gs__st_ptrs4(private_st, stname, stype, sname, penum, preloc, e1, e2, e3, e4)
|
|
|
741 |
|
|
|
742 |
/* Structures with 5 pointers. */
|
|
|
743 |
|
|
|
744 |
#define gs__st_ptrs5(scope_st, stname, stype, sname, penum, preloc, e1, e2, e3, e4, e5)\
|
|
|
745 |
BASIC_PTRS(penum) {\
|
|
|
746 |
GC_OBJ_ELT3(stype, e1, e2, e3), GC_OBJ_ELT2(stype, e4, e5)\
|
|
|
747 |
};\
|
|
|
748 |
gs__st_basic(scope_st, stname, stype, sname, penum, preloc)
|
|
|
749 |
#define gs_public_st_ptrs5(stname, stype, sname, penum, preloc, e1, e2, e3, e4, e5)\
|
|
|
750 |
gs__st_ptrs5(public_st, stname, stype, sname, penum, preloc, e1, e2, e3, e4, e5)
|
|
|
751 |
#define gs_private_st_ptrs5(stname, stype, sname, penum, preloc, e1, e2, e3, e4, e5)\
|
|
|
752 |
gs__st_ptrs5(private_st, stname, stype, sname, penum, preloc, e1, e2, e3, e4, e5)
|
|
|
753 |
|
|
|
754 |
/* Structures with 6 pointers. */
|
|
|
755 |
|
|
|
756 |
#define gs__st_ptrs6(scope_st, stname, stype, sname, penum, preloc, e1, e2, e3, e4, e5, e6)\
|
|
|
757 |
BASIC_PTRS(penum) {\
|
|
|
758 |
GC_OBJ_ELT3(stype, e1, e2, e3), GC_OBJ_ELT3(stype, e4, e5, e6)\
|
|
|
759 |
};\
|
|
|
760 |
gs__st_basic(scope_st, stname, stype, sname, penum, preloc)
|
|
|
761 |
#define gs_public_st_ptrs6(stname, stype, sname, penum, preloc, e1, e2, e3, e4, e5, e6)\
|
|
|
762 |
gs__st_ptrs6(public_st, stname, stype, sname, penum, preloc, e1, e2, e3, e4, e5, e6)
|
|
|
763 |
#define gs_private_st_ptrs6(stname, stype, sname, penum, preloc, e1, e2, e3, e4, e5, e6)\
|
|
|
764 |
gs__st_ptrs6(private_st, stname, stype, sname, penum, preloc, e1, e2, e3, e4, e5, e6)
|
|
|
765 |
|
|
|
766 |
/* Structures with 7 pointers. */
|
|
|
767 |
|
|
|
768 |
#define gs__st_ptrs7(scope_st, stname, stype, sname, penum, preloc, e1, e2, e3, e4, e5, e6, e7)\
|
|
|
769 |
BASIC_PTRS(penum) {\
|
|
|
770 |
GC_OBJ_ELT3(stype, e1, e2, e3), GC_OBJ_ELT3(stype, e4, e5, e6), GC_OBJ_ELT(stype, e7)\
|
|
|
771 |
};\
|
|
|
772 |
gs__st_basic(scope_st, stname, stype, sname, penum, preloc)
|
|
|
773 |
#define gs_public_st_ptrs7(stname, stype, sname, penum, preloc, e1, e2, e3, e4, e5, e6, e7)\
|
|
|
774 |
gs__st_ptrs7(public_st, stname, stype, sname, penum, preloc, e1, e2, e3, e4, e5, e6, e7)
|
|
|
775 |
#define gs_private_st_ptrs7(stname, stype, sname, penum, preloc, e1, e2, e3, e4, e5, e6, e7)\
|
|
|
776 |
gs__st_ptrs7(private_st, stname, stype, sname, penum, preloc, e1, e2, e3, e4, e5, e6, e7)
|
|
|
777 |
|
|
|
778 |
/* Structures with 1 const string and 7 pointers. */
|
|
|
779 |
|
|
|
780 |
#define gs__st_strings1_ptrs7(scope_st, stname, stype, sname, penum, preloc, e1, e2, e3, e4, e5, e6, e7, e8)\
|
|
|
781 |
BASIC_PTRS(penum) {\
|
|
|
782 |
GC_CONST_STRING_ELT(stype, e1),\
|
|
|
783 |
GC_OBJ_ELT3(stype, e2, e3, e4), GC_OBJ_ELT3(stype, e5, e6, e7), GC_OBJ_ELT(stype, e8)\
|
|
|
784 |
};\
|
|
|
785 |
gs__st_basic(scope_st, stname, stype, sname, penum, preloc)
|
|
|
786 |
#define gs_public_st_strings1_ptrs7(stname, stype, sname, penum, preloc, e1, e2, e3, e4, e5, e6, e7, e8)\
|
|
|
787 |
gs__st_strings1_ptrs7(public_st, stname, stype, sname, penum, preloc, e1, e2, e3, e4, e5, e6, e7, e8)
|
|
|
788 |
#define gs_private_st_strings1_ptrs7(stname, stype, sname, penum, preloc, e1, e2, e3, e4, e5, e6, e7, e8)\
|
|
|
789 |
gs__st_strings1_ptrs7(private_st, stname, stype, sname, penum, preloc, e1, e2, e3, e4, e5, e6, e7, e8)
|
|
|
790 |
|
|
|
791 |
/* ---------------- Suffix subclasses ---------------- */
|
|
|
792 |
|
|
|
793 |
/* Suffix subclasses with no additional pointers. */
|
|
|
794 |
|
|
|
795 |
#define gs__st_suffix_add0(scope_st, stname, stype, sname, penum, preloc, supstname)\
|
|
|
796 |
gs__st_basic_with_super_final(scope_st, stname, stype, sname, 0, 0, preloc, &supstname, 0, 0)
|
|
|
797 |
#define gs_public_st_suffix_add0(stname, stype, sname, penum, preloc, supstname)\
|
|
|
798 |
gs__st_suffix_add0(public_st, stname, stype, sname, penum, preloc, supstname)
|
|
|
799 |
#define gs_private_st_suffix_add0(stname, stype, sname, penum, preloc, supstname)\
|
|
|
800 |
gs__st_suffix_add0(private_st, stname, stype, sname, penum, preloc, supstname)
|
|
|
801 |
|
|
|
802 |
/* Suffix subclasses with no additional pointers, */
|
|
|
803 |
/* and with the superclass defined earlier in the same file */
|
|
|
804 |
/* as a 'basic' type. */
|
|
|
805 |
/* In this case, we don't even need new procedures. */
|
|
|
806 |
|
|
|
807 |
#define gs__st_suffix_add0_local(scope_st, stname, stype, sname, supenum, supreloc, supstname)\
|
|
|
808 |
scope_st stname = {\
|
|
|
809 |
sizeof(stype), sname, 0, 0, basic_enum_ptrs, basic_reloc_ptrs,\
|
|
|
810 |
0, &supreloc\
|
|
|
811 |
}
|
|
|
812 |
#define gs_public_st_suffix_add0_local(stname, stype, sname, supenum, supreloc, supstname)\
|
|
|
813 |
gs__st_suffix_add0_local(public_st, stname, stype, sname, supenum, supreloc, supstname)
|
|
|
814 |
#define gs_private_st_suffix_add0_local(stname, stype, sname, supenum, supreloc, supstname)\
|
|
|
815 |
gs__st_suffix_add0_local(private_st, stname, stype, sname, supenum, supreloc, supstname)
|
|
|
816 |
|
|
|
817 |
/* Suffix subclasses with no additional pointers and finalization. */
|
|
|
818 |
/* This is a hack -- subclasses should inherit finalization, */
|
|
|
819 |
/* but that would require a superclass pointer in the descriptor, */
|
|
|
820 |
/* which would perturb things too much right now. */
|
|
|
821 |
|
|
|
822 |
#define gs__st_suffix_add0_final(scope_st, stname, stype, sname, penum, preloc, pfinal, supstname)\
|
|
|
823 |
private ENUM_PTRS_BEGIN_PROC(penum) {\
|
|
|
824 |
ENUM_PREFIX(supstname, 0);\
|
|
|
825 |
} ENUM_PTRS_END_PROC\
|
|
|
826 |
private RELOC_PTRS_BEGIN(preloc) {\
|
|
|
827 |
RELOC_PREFIX(supstname);\
|
|
|
828 |
} RELOC_PTRS_END\
|
|
|
829 |
gs__st_complex_only(scope_st, stname, stype, sname, 0, penum, preloc, pfinal)
|
|
|
830 |
#define gs_public_st_suffix_add0_final(stname, stype, sname, penum, preloc, pfinal, supstname)\
|
|
|
831 |
gs__st_suffix_add0_final(public_st, stname, stype, sname, penum, preloc, pfinal, supstname)
|
|
|
832 |
#define gs_private_st_suffix_add0_final(stname, stype, sname, penum, preloc, pfinal, supstname)\
|
|
|
833 |
gs__st_suffix_add0_final(private_st, stname, stype, sname, penum, preloc, pfinal, supstname)
|
|
|
834 |
|
|
|
835 |
/* Suffix subclasses with 1 additional pointer. */
|
|
|
836 |
|
|
|
837 |
#define gs__st_suffix_add1(scope_st, stname, stype, sname, penum, preloc, supstname, e1)\
|
|
|
838 |
BASIC_PTRS(penum) {\
|
|
|
839 |
GC_OBJ_ELT(stype, e1)\
|
|
|
840 |
};\
|
|
|
841 |
gs__st_basic_super(scope_st, stname, stype, sname, penum, preloc, &supstname, 0)
|
|
|
842 |
#define gs_public_st_suffix_add1(stname, stype, sname, penum, preloc, supstname, e1)\
|
|
|
843 |
gs__st_suffix_add1(public_st, stname, stype, sname, penum, preloc, supstname, e1)
|
|
|
844 |
#define gs_private_st_suffix_add1(stname, stype, sname, penum, preloc, supstname, e1)\
|
|
|
845 |
gs__st_suffix_add1(private_st, stname, stype, sname, penum, preloc, supstname, e1)
|
|
|
846 |
|
|
|
847 |
/* Suffix subclasses with 1 additional pointer and finalization. */
|
|
|
848 |
/* See above regarding finalization and subclasses. */
|
|
|
849 |
|
|
|
850 |
#define gs__st_suffix_add1_final(scope_st, stname, stype, sname, penum, preloc, pfinal, supstname, e1)\
|
|
|
851 |
BASIC_PTRS(penum) {\
|
|
|
852 |
GC_OBJ_ELT(stype, e1)\
|
|
|
853 |
};\
|
|
|
854 |
gs__st_basic_super_final(scope_st, stname, stype, sname, penum, preloc, &supstname, 0, pfinal)
|
|
|
855 |
#define gs_public_st_suffix_add1_final(stname, stype, sname, penum, preloc, pfinal, supstname, e1)\
|
|
|
856 |
gs__st_suffix_add1_final(public_st, stname, stype, sname, penum, preloc, pfinal, supstname, e1)
|
|
|
857 |
#define gs_private_st_suffix_add1_final(stname, stype, sname, penum, preloc, pfinal, supstname, e1)\
|
|
|
858 |
gs__st_suffix_add1_final(private_st, stname, stype, sname, penum, preloc, pfinal, supstname, e1)
|
|
|
859 |
|
|
|
860 |
/* Suffix subclasses with 1 additional string. */
|
|
|
861 |
|
|
|
862 |
#define gs__st_suffix_add_strings1(scope_st, stname, stype, sname, penum, preloc, supstname, e1)\
|
|
|
863 |
BASIC_PTRS(penum) {\
|
|
|
864 |
GC_STRING_ELT(stype, e1)\
|
|
|
865 |
};\
|
|
|
866 |
gs__st_basic_super(scope_st, stname, stype, sname, penum, preloc, &supstname, 0)
|
|
|
867 |
#define gs_public_st_suffix_add_strings1(stname, stype, sname, penum, preloc, supstname, e1)\
|
|
|
868 |
gs__st_suffix_add_strings1(public_st, stname, stype, sname, penum, preloc, supstname, e1)
|
|
|
869 |
#define gs_private_st_suffix_add_strings1(stname, stype, sname, penum, preloc, supstname, e1)\
|
|
|
870 |
gs__st_suffix_add_strings1(private_st, stname, stype, sname, penum, preloc, supstname, e1)
|
|
|
871 |
|
|
|
872 |
/* Suffix subclasses with 2 additional pointers. */
|
|
|
873 |
|
|
|
874 |
#define gs__st_suffix_add2(scope_st, stname, stype, sname, penum, preloc, supstname, e1, e2)\
|
|
|
875 |
BASIC_PTRS(penum) {\
|
|
|
876 |
GC_OBJ_ELT2(stype, e1, e2)\
|
|
|
877 |
};\
|
|
|
878 |
gs__st_basic_super(scope_st, stname, stype, sname, penum, preloc, &supstname, 0)
|
|
|
879 |
#define gs_public_st_suffix_add2(stname, stype, sname, penum, preloc, supstname, e1, e2)\
|
|
|
880 |
gs__st_suffix_add2(public_st, stname, stype, sname, penum, preloc, supstname, e1, e2)
|
|
|
881 |
#define gs_private_st_suffix_add2(stname, stype, sname, penum, preloc, supstname, e1, e2)\
|
|
|
882 |
gs__st_suffix_add2(private_st, stname, stype, sname, penum, preloc, supstname, e1, e2)
|
|
|
883 |
|
|
|
884 |
/* Suffix subclasses with 2 additional pointers and 1 string. */
|
|
|
885 |
|
|
|
886 |
#define gs__st_suffix_add2_string1(scope_st, stname, stype, sname, penum, preloc, supstname, e1, e2, e3)\
|
|
|
887 |
BASIC_PTRS(penum) {\
|
|
|
888 |
GC_OBJ_ELT2(stype, e1, e2),\
|
|
|
889 |
GC_STRING_ELT(stype, e3)\
|
|
|
890 |
};\
|
|
|
891 |
gs__st_basic_super(scope_st, stname, stype, sname, penum, preloc, &supstname, 0)
|
|
|
892 |
#define gs_public_st_suffix_add2_string1(stname, stype, sname, penum, preloc, supstname, e1, e2, e3)\
|
|
|
893 |
gs__st_suffix_add2_string1(public_st, stname, stype, sname, penum, preloc, supstname, e1, e2, e3)
|
|
|
894 |
#define gs_private_st_suffix_add2_string1(stname, stype, sname, penum, preloc, supstname, e1, e2, e3)\
|
|
|
895 |
gs__st_suffix_add2_string1(private_st, stname, stype, sname, penum, preloc, supstname, e1, e2, e3)
|
|
|
896 |
|
|
|
897 |
/* Suffix subclasses with 2 additional pointers and finalization. */
|
|
|
898 |
/* See above regarding finalization and subclasses. */
|
|
|
899 |
|
|
|
900 |
#define gs__st_suffix_add2_final(scope_st, stname, stype, sname, penum, preloc, pfinal, supstname, e1, e2)\
|
|
|
901 |
BASIC_PTRS(penum) {\
|
|
|
902 |
GC_OBJ_ELT2(stype, e1, e2)\
|
|
|
903 |
};\
|
|
|
904 |
gs__st_basic_super_final(scope_st, stname, stype, sname, penum, preloc, &supstname, 0, pfinal)
|
|
|
905 |
#define gs_public_st_suffix_add2_final(stname, stype, sname, penum, preloc, pfinal, supstname, e1, e2)\
|
|
|
906 |
gs__st_suffix_add2_final(public_st, stname, stype, sname, penum, preloc, pfinal, supstname, e1, e2)
|
|
|
907 |
#define gs_private_st_suffix_add2_final(stname, stype, sname, penum, preloc, pfinal, supstname, e1, e2)\
|
|
|
908 |
gs__st_suffix_add2_final(private_st, stname, stype, sname, penum, preloc, pfinal, supstname, e1, e2)
|
|
|
909 |
|
|
|
910 |
/* Suffix subclasses with 3 additional pointers. */
|
|
|
911 |
|
|
|
912 |
#define gs__st_suffix_add3(scope_st, stname, stype, sname, penum, preloc, supstname, e1, e2, e3)\
|
|
|
913 |
BASIC_PTRS(penum) {\
|
|
|
914 |
GC_OBJ_ELT3(stype, e1, e2, e3)\
|
|
|
915 |
};\
|
|
|
916 |
gs__st_basic_super(scope_st, stname, stype, sname, penum, preloc, &supstname, 0)
|
|
|
917 |
#define gs_public_st_suffix_add3(stname, stype, sname, penum, preloc, supstname, e1, e2, e3)\
|
|
|
918 |
gs__st_suffix_add3(public_st, stname, stype, sname, penum, preloc, supstname, e1, e2, e3)
|
|
|
919 |
#define gs_private_st_suffix_add3(stname, stype, sname, penum, preloc, supstname, e1, e2, e3)\
|
|
|
920 |
gs__st_suffix_add3(private_st, stname, stype, sname, penum, preloc, supstname, e1, e2, e3)
|
|
|
921 |
|
|
|
922 |
/* Suffix subclasses with 3 additional pointers and 1 string. */
|
|
|
923 |
|
|
|
924 |
#define gs__st_suffix_add3_string1(scope_st, stname, stype, sname, penum, preloc, supstname, e1, e2, e3, e4)\
|
|
|
925 |
BASIC_PTRS(penum) {\
|
|
|
926 |
GC_OBJ_ELT3(stype, e1, e2, e3),\
|
|
|
927 |
GC_STRING_ELT(stype, e4)\
|
|
|
928 |
};\
|
|
|
929 |
gs__st_basic_super(scope_st, stname, stype, sname, penum, preloc, &supstname, 0)
|
|
|
930 |
#define gs_public_st_suffix_add3_string1(stname, stype, sname, penum, preloc, supstname, e1, e2, e3, e4)\
|
|
|
931 |
gs__st_suffix_add3_string1(public_st, stname, stype, sname, penum, preloc, supstname, e1, e2, e3, e4)
|
|
|
932 |
#define gs_private_st_suffix_add3_string1(stname, stype, sname, penum, preloc, supstname, e1, e2, e3, e4)\
|
|
|
933 |
gs__st_suffix_add3_string1(private_st, stname, stype, sname, penum, preloc, supstname, e1, e2, e3, e4)
|
|
|
934 |
|
|
|
935 |
/* Suffix subclasses with 3 additional pointers and finalization. */
|
|
|
936 |
/* See above regarding finalization and subclasses. */
|
|
|
937 |
|
|
|
938 |
#define gs__st_suffix_add3_final(scope_st, stname, stype, sname, penum, preloc, pfinal, supstname, e1, e2, e3)\
|
|
|
939 |
BASIC_PTRS(penum) {\
|
|
|
940 |
GC_OBJ_ELT3(stype, e1, e2, e3)\
|
|
|
941 |
};\
|
|
|
942 |
gs__st_basic_super_final(scope_st, stname, stype, sname, penum, preloc, &supstname, 0, pfinal)
|
|
|
943 |
#define gs_public_st_suffix_add3_final(stname, stype, sname, penum, preloc, pfinal, supstname, e1, e2, e3)\
|
|
|
944 |
gs__st_suffix_add3_final(public_st, stname, stype, sname, penum, preloc, pfinal, supstname, e1, e2, e3)
|
|
|
945 |
#define gs_private_st_suffix_add3_final(stname, stype, sname, penum, preloc, pfinal, supstname, e1, e2, e3)\
|
|
|
946 |
gs__st_suffix_add3_final(private_st, stname, stype, sname, penum, preloc, pfinal, supstname, e1, e2, e3)
|
|
|
947 |
|
|
|
948 |
/* Suffix subclasses with 4 additional pointers. */
|
|
|
949 |
|
|
|
950 |
#define gs__st_suffix_add4(scope_st, stname, stype, sname, penum, preloc, supstname, e1, e2, e3, e4)\
|
|
|
951 |
BASIC_PTRS(penum) {\
|
|
|
952 |
GC_OBJ_ELT3(stype, e1, e2, e3), GC_OBJ_ELT(stype, e4)\
|
|
|
953 |
};\
|
|
|
954 |
gs__st_basic_super(scope_st, stname, stype, sname, penum, preloc, &supstname, 0)
|
|
|
955 |
#define gs_public_st_suffix_add4(stname, stype, sname, penum, preloc, supstname, e1, e2, e3, e4)\
|
|
|
956 |
gs__st_suffix_add4(public_st, stname, stype, sname, penum, preloc, supstname, e1, e2, e3, e4)
|
|
|
957 |
#define gs_private_st_suffix_add4(stname, stype, sname, penum, preloc, supstname, e1, e2, e3, e4)\
|
|
|
958 |
gs__st_suffix_add4(private_st, stname, stype, sname, penum, preloc, supstname, e1, e2, e3, e4)
|
|
|
959 |
|
|
|
960 |
/* Suffix subclasses with 4 additional pointers and finalization. */
|
|
|
961 |
/* See above regarding finalization and subclasses. */
|
|
|
962 |
|
|
|
963 |
#define gs__st_suffix_add4_final(scope_st, stname, stype, sname, penum, preloc, pfinal, supstname, e1, e2, e3, e4)\
|
|
|
964 |
BASIC_PTRS(penum) {\
|
|
|
965 |
GC_OBJ_ELT3(stype, e1, e2, e3), GC_OBJ_ELT(stype, e4)\
|
|
|
966 |
};\
|
|
|
967 |
gs__st_basic_super_final(scope_st, stname, stype, sname, penum, preloc, &supstname, 0, pfinal)
|
|
|
968 |
#define gs_public_st_suffix_add4_final(stname, stype, sname, penum, preloc, pfinal, supstname, e1, e2, e3, e4)\
|
|
|
969 |
gs__st_suffix_add4_final(public_st, stname, stype, sname, penum, preloc, pfinal, supstname, e1, e2, e3, e4)
|
|
|
970 |
#define gs_private_st_suffix_add4_final(stname, stype, sname, penum, preloc, pfinal, supstname, e1, e2, e3, e4)\
|
|
|
971 |
gs__st_suffix_add4_final(private_st, stname, stype, sname, penum, preloc, pfinal, supstname, e1, e2, e3, e4)
|
|
|
972 |
|
|
|
973 |
/* Suffix subclasses with 5 additional pointers. */
|
|
|
974 |
|
|
|
975 |
#define gs__st_suffix_add5(scope_st, stname, stype, sname, penum, preloc, supstname, e1, e2, e3, e4, e5)\
|
|
|
976 |
BASIC_PTRS(penum) {\
|
|
|
977 |
GC_OBJ_ELT3(stype, e1, e2, e3), GC_OBJ_ELT2(stype, e4, e5)\
|
|
|
978 |
};\
|
|
|
979 |
gs__st_basic_super(scope_st, stname, stype, sname, penum, preloc, &supstname, 0)
|
|
|
980 |
#define gs_public_st_suffix_add5(stname, stype, sname, penum, preloc, supstname, e1, e2, e3, e4, e5)\
|
|
|
981 |
gs__st_suffix_add5(public_st, stname, stype, sname, penum, preloc, supstname, e1, e2, e3, e4, e5)
|
|
|
982 |
#define gs_private_st_suffix_add5(stname, stype, sname, penum, preloc, supstname, e1, e2, e3, e4, e5)\
|
|
|
983 |
gs__st_suffix_add5(private_st, stname, stype, sname, penum, preloc, supstname, e1, e2, e3, e4, e5)
|
|
|
984 |
|
|
|
985 |
/* Suffix subclasses with 6 additional pointers. */
|
|
|
986 |
|
|
|
987 |
#define gs__st_suffix_add6(scope_st, stname, stype, sname, penum, preloc, supstname, e1, e2, e3, e4, e5, e6)\
|
|
|
988 |
BASIC_PTRS(penum) {\
|
|
|
989 |
GC_OBJ_ELT3(stype, e1, e2, e3), GC_OBJ_ELT3(stype, e4, e5, e6)\
|
|
|
990 |
};\
|
|
|
991 |
gs__st_basic_super(scope_st, stname, stype, sname, penum, preloc, &supstname, 0)
|
|
|
992 |
#define gs_public_st_suffix_add6(stname, stype, sname, penum, preloc, supstname, e1, e2, e3, e4, e5, e6)\
|
|
|
993 |
gs__st_suffix_add6(public_st, stname, stype, sname, penum, preloc, supstname, e1, e2, e3, e4, e5, e6)
|
|
|
994 |
#define gs_private_st_suffix_add6(stname, stype, sname, penum, preloc, supstname, e1, e2, e3, e4, e5, e6)\
|
|
|
995 |
gs__st_suffix_add6(private_st, stname, stype, sname, penum, preloc, supstname, e1, e2, e3, e4, e5, e6)
|
|
|
996 |
|
|
|
997 |
/* Suffix subclasses with 7 additional pointers. */
|
|
|
998 |
|
|
|
999 |
#define gs__st_suffix_add7(scope_st, stname, stype, sname, penum, preloc, supstname, e1, e2, e3, e4, e5, e6, e7)\
|
|
|
1000 |
BASIC_PTRS(penum) {\
|
|
|
1001 |
GC_OBJ_ELT3(stype, e1, e2, e3), GC_OBJ_ELT3(stype, e4, e5, e6),\
|
|
|
1002 |
GC_OBJ_ELT(stype, e7)\
|
|
|
1003 |
};\
|
|
|
1004 |
gs__st_basic_super(scope_st, stname, stype, sname, penum, preloc, &supstname, 0)
|
|
|
1005 |
#define gs_public_st_suffix_add7(stname, stype, sname, penum, preloc, supstname, e1, e2, e3, e4, e5, e6, e7)\
|
|
|
1006 |
gs__st_suffix_add7(public_st, stname, stype, sname, penum, preloc, supstname, e1, e2, e3, e4, e5, e6, e7)
|
|
|
1007 |
#define gs_private_st_suffix_add7(stname, stype, sname, penum, preloc, supstname, e1, e2, e3, e4, e5, e6, e7)\
|
|
|
1008 |
gs__st_suffix_add7(private_st, stname, stype, sname, penum, preloc, supstname, e1, e2, e3, e4, e5, e6, e7)
|
|
|
1009 |
|
|
|
1010 |
/* Suffix subclasses with 8 additional pointers. */
|
|
|
1011 |
|
|
|
1012 |
#define gs__st_suffix_add8(scope_st, stname, stype, sname, penum, preloc, supstname, e1, e2, e3, e4, e5, e6, e7, e8)\
|
|
|
1013 |
BASIC_PTRS(penum) {\
|
|
|
1014 |
GC_OBJ_ELT3(stype, e1, e2, e3), GC_OBJ_ELT3(stype, e4, e5, e6),\
|
|
|
1015 |
GC_OBJ_ELT2(stype, e7, e8)\
|
|
|
1016 |
};\
|
|
|
1017 |
gs__st_basic_super(scope_st, stname, stype, sname, penum, preloc, &supstname, 0)
|
|
|
1018 |
#define gs_public_st_suffix_add8(stname, stype, sname, penum, preloc, supstname, e1, e2, e3, e4, e5, e6, e7, e8)\
|
|
|
1019 |
gs__st_suffix_add8(public_st, stname, stype, sname, penum, preloc, supstname, e1, e2, e3, e4, e5, e6, e7, e8)
|
|
|
1020 |
#define gs_private_st_suffix_add8(stname, stype, sname, penum, preloc, supstname, e1, e2, e3, e4, e5, e6, e7, e8)\
|
|
|
1021 |
gs__st_suffix_add8(private_st, stname, stype, sname, penum, preloc, supstname, e1, e2, e3, e4, e5, e6, e7, e8)
|
|
|
1022 |
|
|
|
1023 |
/* Suffix subclasses with 9 additional pointers. */
|
|
|
1024 |
|
|
|
1025 |
#define gs__st_suffix_add9(scope_st, stname, stype, sname, penum, preloc, supstname, e1, e2, e3, e4, e5, e6, e7, e8, e9)\
|
|
|
1026 |
BASIC_PTRS(penum) {\
|
|
|
1027 |
GC_OBJ_ELT3(stype, e1, e2, e3), GC_OBJ_ELT3(stype, e4, e5, e6),\
|
|
|
1028 |
GC_OBJ_ELT3(stype, e7, e8, e9)\
|
|
|
1029 |
};\
|
|
|
1030 |
gs__st_basic_super(scope_st, stname, stype, sname, penum, preloc, &supstname, 0)
|
|
|
1031 |
#define gs_public_st_suffix_add9(stname, stype, sname, penum, preloc, supstname, e1, e2, e3, e4, e5, e6, e7, e8, e9)\
|
|
|
1032 |
gs__st_suffix_add9(public_st, stname, stype, sname, penum, preloc, supstname, e1, e2, e3, e4, e5, e6, e7, e8, e9)
|
|
|
1033 |
#define gs_private_st_suffix_add9(stname, stype, sname, penum, preloc, supstname, e1, e2, e3, e4, e5, e6, e7, e8, e9)\
|
|
|
1034 |
gs__st_suffix_add9(private_st, stname, stype, sname, penum, preloc, supstname, e1, e2, e3, e4, e5, e6, e7, e8, e9)
|
|
|
1035 |
|
|
|
1036 |
/* Suffix subclasses with 10 additional pointers. */
|
|
|
1037 |
|
|
|
1038 |
#define gs__st_suffix_add10(scope_st, stname, stype, sname, penum, preloc, supstname, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10)\
|
|
|
1039 |
BASIC_PTRS(penum) {\
|
|
|
1040 |
GC_OBJ_ELT3(stype, e1, e2, e3), GC_OBJ_ELT3(stype, e4, e5, e6),\
|
|
|
1041 |
GC_OBJ_ELT3(stype, e7, e8, e9), GC_OBJ_ELT(stype, e10)\
|
|
|
1042 |
};\
|
|
|
1043 |
gs__st_basic_super(scope_st, stname, stype, sname, penum, preloc, &supstname, 0)
|
|
|
1044 |
#define gs_public_st_suffix_add10(stname, stype, sname, penum, preloc, supstname, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10)\
|
|
|
1045 |
gs__st_suffix_add10(public_st, stname, stype, sname, penum, preloc, supstname, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10)
|
|
|
1046 |
#define gs_private_st_suffix_add10(stname, stype, sname, penum, preloc, supstname, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10)\
|
|
|
1047 |
gs__st_suffix_add10(private_st, stname, stype, sname, penum, preloc, supstname, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10)
|
|
|
1048 |
|
|
|
1049 |
/* Suffix subclasses with 11 additional pointers. */
|
|
|
1050 |
|
|
|
1051 |
#define gs__st_suffix_add11(scope_st, stname, stype, sname, penum, preloc, supstname, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, e11)\
|
|
|
1052 |
BASIC_PTRS(penum) {\
|
|
|
1053 |
GC_OBJ_ELT3(stype, e1, e2, e3), GC_OBJ_ELT3(stype, e4, e5, e6),\
|
|
|
1054 |
GC_OBJ_ELT3(stype, e7, e8, e9), GC_OBJ_ELT2(stype, e10, e11)\
|
|
|
1055 |
};\
|
|
|
1056 |
gs__st_basic_super(scope_st, stname, stype, sname, penum, preloc, &supstname, 0)
|
|
|
1057 |
#define gs_public_st_suffix_add11(stname, stype, sname, penum, preloc, supstname, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, e11)\
|
|
|
1058 |
gs__st_suffix_add11(public_st, stname, stype, sname, penum, preloc, supstname, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, e11)
|
|
|
1059 |
#define gs_private_st_suffix_add11(stname, stype, sname, penum, preloc, supstname, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, e11)\
|
|
|
1060 |
gs__st_suffix_add11(private_st, stname, stype, sname, penum, preloc, supstname, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, e11)
|
|
|
1061 |
|
|
|
1062 |
/* ---------------- General subclasses ---------------- */
|
|
|
1063 |
|
|
|
1064 |
/* General subclasses with no additional pointers. */
|
|
|
1065 |
|
|
|
1066 |
#define gs__st_ptrs_add0(scope_st, stname, stype, sname, penum, preloc, supstname, member)\
|
|
|
1067 |
gs__st_basic_with_super_final(scope_st, stname, stype, sname, 0, 0, preloc, &supstname, offset_of(stype, member), 0)
|
|
|
1068 |
#define gs_public_st_ptrs_add0(stname, stype, sname, penum, preloc, supstname, member)\
|
|
|
1069 |
gs__st_ptrs_add0(public_st, stname, stype, sname, penum, preloc, supstname, member)
|
|
|
1070 |
#define gs_private_st_ptrs_add0(stname, stype, sname, penum, preloc, supstname, member)\
|
|
|
1071 |
gs__st_ptrs_add0(private_st, stname, stype, sname, penum, preloc, supstname, member)
|
|
|
1072 |
|
|
|
1073 |
/* General subclasses with 1 additional pointer. */
|
|
|
1074 |
|
|
|
1075 |
#define gs__st_ptrs_add1(scope_st, stname, stype, sname, penum, preloc, supstname, member, e1)\
|
|
|
1076 |
BASIC_PTRS(penum) {\
|
|
|
1077 |
GC_OBJ_ELT(stype, e1)\
|
|
|
1078 |
};\
|
|
|
1079 |
gs__st_basic_super(scope_st, stname, stype, sname, penum, preloc, &supstname, offset_of(stype, member))
|
|
|
1080 |
#define gs_public_st_ptrs_add1(stname, stype, sname, penum, preloc, supstname, member, e1)\
|
|
|
1081 |
gs__st_ptrs_add1(public_st, stname, stype, sname, penum, preloc, supstname, member, e1)
|
|
|
1082 |
#define gs_private_st_ptrs_add1(stname, stype, sname, penum, preloc, supstname, member, e1)\
|
|
|
1083 |
gs__st_ptrs_add1(private_st, stname, stype, sname, penum, preloc, supstname, member, e1)
|
|
|
1084 |
|
|
|
1085 |
/* General subclasses with 2 additional pointers. */
|
|
|
1086 |
|
|
|
1087 |
#define gs__st_ptrs_add2(scope_st, stname, stype, sname, penum, preloc, supstname, member, e1, e2)\
|
|
|
1088 |
BASIC_PTRS(penum) {\
|
|
|
1089 |
GC_OBJ_ELT2(stype, e1, e2)\
|
|
|
1090 |
};\
|
|
|
1091 |
gs__st_basic_super(scope_st, stname, stype, sname, penum, preloc, &supstname, offset_of(stype, member))
|
|
|
1092 |
#define gs_public_st_ptrs_add2(stname, stype, sname, penum, preloc, supstname, member, e1, e2)\
|
|
|
1093 |
gs__st_ptrs_add2(public_st, stname, stype, sname, penum, preloc, supstname, member, e1, e2)
|
|
|
1094 |
#define gs_private_st_ptrs_add2(stname, stype, sname, penum, preloc, supstname, member, e1, e2)\
|
|
|
1095 |
gs__st_ptrs_add2(private_st, stname, stype, sname, penum, preloc, supstname, member, e1, e2)
|
|
|
1096 |
|
|
|
1097 |
#endif /* gsstruct_INCLUDED */
|