Debian Codegraph @

terps/tads/tads3/vmpoolsl.h

raw symbols SCIP
1 /*
2 * Copyright (c) 2002 by Michael J. Roberts. All Rights Reserved.
3 *
4 * Please see the accompanying license file, LICENSE.TXT, for information
5 * on using and copying this software.
6 */
7 /*
8 Name
9 vmpoolsl.h - pool manager selector definitions
10 Function
11 This header makes some definitions that vary according to which type of
12 memory pool manager is selected. This can be included without including
13 the entire memory pool subsystem header.
14 Notes
15 As of this writing, only the all-in-memory pool manager is supported.
16 The swapping pool manager is no longer supported and is not planned to be
17 supported in the future. However, we are retaining the selection mechanism
18 for now, in the event that we want to restore the swapping pool, or add
19 other pool configuration options, in the future (which seems unlikely, but
20 still).
21 Modified
22 08/17/02 MJRoberts - Creation
23 */
24
25 #ifndef VMPOOLSL_H
26 #define VMPOOLSL_H
27
28 /* ------------------------------------------------------------------------ */
29 /*
30 * Conditionally include code needed for the swapping pool manager. When
31 * the swapping pool manager is used, code that translates memory addresses
32 * must be mindful of the fact that translating one memory address can
33 * render previously-translated addresses invalid. Such code is
34 * unnecessary with non-swapping pool managers.
35 *
36 * To include the swapping pool manager in the build, you must #define
37 * VM_SWAPPING_POOL globally for all modules - normally, this should be
38 * done in the CFLAGS in the makefile, or with the equivalent local
39 * convention, so that every module has the symbol defined.
40 */
41
42 /* ------------------------------------------------------------------------ */
43 #ifdef VM_SWAPPING_POOL
44
45 /*
46 * swapping mode - include swapping-specific code
47 */
48 #define VM_IF_SWAPPING_POOL(x) x
49
50 /* the final pool manager subclass - use the swapping pool class */
51 #define CVmPool_CLASS CVmPoolSwap
52
53 /* ------------------------------------------------------------------------ */
54 #else /* VM_SWAPPING_POOL */
55
56 /*
57 * non-swapping mode - omit swapping-specific code
58 */
59 #define VM_IF_SWAPPING_POOL(x)
60
61 /*
62 * The non-swapping pool comes in two varieties. Select the FLAT or PAGED
63 * pool, as desired. The FLAT pool is slightly faster, but it doesn't have
64 * any dynamic memory capabilities, which are required for the debugger.
65 */
66 #ifdef VM_FLAT_POOL
67
68 /* select the non-swapped FLAT pool */
69 #define CVmPool_CLASS CVmPoolFlat
70
71 #else /* VM_FLAT_POOL */
72
73 /* select the non-swapped PAGED pool */
74 #define CVmPool_CLASS CVmPoolInMem
75
76 #endif /* VM_FLAT_POOL */
77
78 #endif /* VM_SWAPPING_POOL */
79
80 #endif /* VMPOOLSL_H */