diff options
| author | Richard Brooksby | 2013-05-09 00:06:07 +0100 |
|---|---|---|
| committer | Richard Brooksby | 2013-05-09 00:06:07 +0100 |
| commit | 3189ccfc9be2f8e791017f051668dd8ca704ea99 (patch) | |
| tree | 40a4856bff2094aab830341beef622e1698458f9 /mps/code | |
| parent | b323278e18ff946f99d742a11dad870fd2dc3007 (diff) | |
| download | emacs-3189ccfc9be2f8e791017f051668dd8ca704ea99.tar.gz emacs-3189ccfc9be2f8e791017f051668dd8ca704ea99.zip | |
Consolidating common pool keywords.
Copied from Perforce
Change: 181649
ServerID: perforce.ravenbrook.com
Diffstat (limited to 'mps/code')
| -rw-r--r-- | mps/code/arg.c | 7 | ||||
| -rw-r--r-- | mps/code/cbs.c | 2 | ||||
| -rw-r--r-- | mps/code/dbgpool.c | 2 | ||||
| -rw-r--r-- | mps/code/mps.h | 15 | ||||
| -rw-r--r-- | mps/code/mps.xcodeproj/project.pbxproj | 8 | ||||
| -rw-r--r-- | mps/code/mpscmfs.h | 2 | ||||
| -rw-r--r-- | mps/code/mpscmv.h | 7 | ||||
| -rw-r--r-- | mps/code/mpscmvff.h | 6 | ||||
| -rw-r--r-- | mps/code/mpscmvt.h | 6 | ||||
| -rw-r--r-- | mps/code/pool.c | 5 | ||||
| -rw-r--r-- | mps/code/poolmfs.c | 5 | ||||
| -rw-r--r-- | mps/code/poolmv.c | 20 | ||||
| -rw-r--r-- | mps/code/poolmv2.c | 12 | ||||
| -rw-r--r-- | mps/code/poolmvff.c | 15 |
14 files changed, 53 insertions, 59 deletions
diff --git a/mps/code/arg.c b/mps/code/arg.c index d65de21a9e8..0338e22405d 100644 --- a/mps/code/arg.c +++ b/mps/code/arg.c | |||
| @@ -23,6 +23,12 @@ Bool ArgCheckCant(Arg arg) { | |||
| 23 | return TRUE; | 23 | return TRUE; |
| 24 | } | 24 | } |
| 25 | 25 | ||
| 26 | static Bool ArgCheckShouldnt(Arg arg) { | ||
| 27 | UNUSED(arg); | ||
| 28 | NOTREACHED; | ||
| 29 | return FALSE; | ||
| 30 | } | ||
| 31 | |||
| 26 | Bool ArgCheckFormat(Arg arg) { | 32 | Bool ArgCheckFormat(Arg arg) { |
| 27 | CHECKD(Format, arg->val.format); | 33 | CHECKD(Format, arg->val.format); |
| 28 | return TRUE; | 34 | return TRUE; |
| @@ -69,6 +75,7 @@ Bool ArgCheckCount(Arg arg) { | |||
| 69 | } | 75 | } |
| 70 | 76 | ||
| 71 | 77 | ||
| 78 | ARG_DEFINE_KEY(args_end, Shouldnt); | ||
| 72 | 79 | ||
| 73 | ArgStruct mps_args_none[] = {{MPS_KEY_ARGS_END}}; | 80 | ArgStruct mps_args_none[] = {{MPS_KEY_ARGS_END}}; |
| 74 | 81 | ||
diff --git a/mps/code/cbs.c b/mps/code/cbs.c index 4c48c690cc3..23a66699333 100644 --- a/mps/code/cbs.c +++ b/mps/code/cbs.c | |||
| @@ -289,7 +289,7 @@ Res CBSInit(Arena arena, CBS cbs, void *owner, | |||
| 289 | fastFind ? &cbsUpdateNode : NULL); | 289 | fastFind ? &cbsUpdateNode : NULL); |
| 290 | args[0].key = MPS_KEY_MFS_UNIT_SIZE; | 290 | args[0].key = MPS_KEY_MFS_UNIT_SIZE; |
| 291 | args[0].val.size = sizeof(CBSBlockStruct); | 291 | args[0].val.size = sizeof(CBSBlockStruct); |
| 292 | args[1].key = MPS_KEY_MFS_EXTEND_BY; | 292 | args[1].key = MPS_KEY_EXTEND_BY; |
| 293 | args[1].val.size = sizeof(CBSBlockStruct) * 64; | 293 | args[1].val.size = sizeof(CBSBlockStruct) * 64; |
| 294 | args[2].key = MPS_KEY_ARGS_END; | 294 | args[2].key = MPS_KEY_ARGS_END; |
| 295 | res = PoolCreate(&(cbs->blockPool), arena, PoolClassMFS(), args); | 295 | res = PoolCreate(&(cbs->blockPool), arena, PoolClassMFS(), args); |
diff --git a/mps/code/dbgpool.c b/mps/code/dbgpool.c index 877695481b1..591a7ce39de 100644 --- a/mps/code/dbgpool.c +++ b/mps/code/dbgpool.c | |||
| @@ -189,7 +189,7 @@ static Res DebugPoolInit(Pool pool, ArgList args) | |||
| 189 | debug->tagSize = tagSize + sizeof(tagStruct) - 1; | 189 | debug->tagSize = tagSize + sizeof(tagStruct) - 1; |
| 190 | /* This pool has to be like the arena control pool: the blocks */ | 190 | /* This pool has to be like the arena control pool: the blocks */ |
| 191 | /* allocated must be accessible using void*. */ | 191 | /* allocated must be accessible using void*. */ |
| 192 | pcArgs[0].key = MPS_KEY_MFS_EXTEND_BY; | 192 | pcArgs[0].key = MPS_KEY_EXTEND_BY; |
| 193 | pcArgs[0].val.size = debug->tagSize; /* FIXME: Really? */ | 193 | pcArgs[0].val.size = debug->tagSize; /* FIXME: Really? */ |
| 194 | pcArgs[1].key = MPS_KEY_MFS_UNIT_SIZE; | 194 | pcArgs[1].key = MPS_KEY_MFS_UNIT_SIZE; |
| 195 | pcArgs[1].val.size = debug->tagSize; | 195 | pcArgs[1].val.size = debug->tagSize; |
diff --git a/mps/code/mps.h b/mps/code/mps.h index 75461373c74..5f320e63c51 100644 --- a/mps/code/mps.h +++ b/mps/code/mps.h | |||
| @@ -115,7 +115,9 @@ typedef struct mps_arg_s { | |||
| 115 | } val; | 115 | } val; |
| 116 | } mps_arg_s; | 116 | } mps_arg_s; |
| 117 | 117 | ||
| 118 | #define MPS_KEY_ARGS_END NULL | 118 | extern const struct mps_key_s _mps_key_args_end; |
| 119 | #define MPS_KEY_ARGS_END (&_mps_key_args_end) | ||
| 120 | extern mps_arg_s mps_args_none[]; | ||
| 119 | 121 | ||
| 120 | /* FIXME: This shouldn't be here */ | 122 | /* FIXME: This shouldn't be here */ |
| 121 | extern const struct mps_key_s _mps_key_vmw3_top_down; | 123 | extern const struct mps_key_s _mps_key_vmw3_top_down; |
| @@ -128,7 +130,16 @@ extern const struct mps_key_s _mps_key_format; | |||
| 128 | extern const struct mps_key_s _mps_key_chain; | 130 | extern const struct mps_key_s _mps_key_chain; |
| 129 | #define MPS_KEY_CHAIN (&_mps_key_chain) | 131 | #define MPS_KEY_CHAIN (&_mps_key_chain) |
| 130 | 132 | ||
| 131 | extern mps_arg_s mps_args_none[]; | 133 | extern const struct mps_key_s _mps_key_extend_by; |
| 134 | #define MPS_KEY_EXTEND_BY (&_mps_key_extend_by) | ||
| 135 | extern const struct mps_key_s _mps_key_min_size; | ||
| 136 | #define MPS_KEY_MIN_SIZE (&_mps_key_min_size) | ||
| 137 | extern const struct mps_key_s _mps_key_mean_size; | ||
| 138 | #define MPS_KEY_MEAN_SIZE (&_mps_key_mean_size) | ||
| 139 | extern const struct mps_key_s _mps_key_max_size; | ||
| 140 | #define MPS_KEY_MAX_SIZE (&_mps_key_max_size) | ||
| 141 | extern const struct mps_key_s _mps_key_align; | ||
| 142 | #define MPS_KEY_ALIGN (&_mps_key_align) | ||
| 132 | 143 | ||
| 133 | 144 | ||
| 134 | /* <a id="message.types"> Keep in sync with | 145 | /* <a id="message.types"> Keep in sync with |
diff --git a/mps/code/mps.xcodeproj/project.pbxproj b/mps/code/mps.xcodeproj/project.pbxproj index fd6b652ae19..3dbaac15900 100644 --- a/mps/code/mps.xcodeproj/project.pbxproj +++ b/mps/code/mps.xcodeproj/project.pbxproj | |||
| @@ -1031,7 +1031,7 @@ | |||
| 1031 | 3114A66C156E95EB001E0AA3 /* btcv.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = btcv.c; sourceTree = "<group>"; }; | 1031 | 3114A66C156E95EB001E0AA3 /* btcv.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = btcv.c; sourceTree = "<group>"; }; |
| 1032 | 3114A67C156E9668001E0AA3 /* mv2test */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = mv2test; sourceTree = BUILT_PRODUCTS_DIR; }; | 1032 | 3114A67C156E9668001E0AA3 /* mv2test */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = mv2test; sourceTree = BUILT_PRODUCTS_DIR; }; |
| 1033 | 3114A686156E9674001E0AA3 /* mv2test.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mv2test.c; sourceTree = "<group>"; }; | 1033 | 3114A686156E9674001E0AA3 /* mv2test.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mv2test.c; sourceTree = "<group>"; }; |
| 1034 | 3114A68E156E96B6001E0AA3 /* poolmv2.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = poolmv2.c; sourceTree = "<group>"; }; | 1034 | 3114A68E156E96B6001E0AA3 /* poolmv2.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; lineEnding = 0; path = poolmv2.c; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.c; }; |
| 1035 | 3114A695156E971B001E0AA3 /* messtest */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = messtest; sourceTree = BUILT_PRODUCTS_DIR; }; | 1035 | 3114A695156E971B001E0AA3 /* messtest */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = messtest; sourceTree = BUILT_PRODUCTS_DIR; }; |
| 1036 | 3114A69F156E9725001E0AA3 /* messtest.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = messtest.c; sourceTree = "<group>"; }; | 1036 | 3114A69F156E9725001E0AA3 /* messtest.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = messtest.c; sourceTree = "<group>"; }; |
| 1037 | 3114A6AC156E9759001E0AA3 /* walkt0 */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = walkt0; sourceTree = BUILT_PRODUCTS_DIR; }; | 1037 | 3114A6AC156E9759001E0AA3 /* walkt0 */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = walkt0; sourceTree = BUILT_PRODUCTS_DIR; }; |
| @@ -1059,7 +1059,7 @@ | |||
| 1059 | 311F2F6117398B0E00C15B6A /* mpm.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = mpm.h; sourceTree = "<group>"; }; | 1059 | 311F2F6117398B0E00C15B6A /* mpm.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = mpm.h; sourceTree = "<group>"; }; |
| 1060 | 311F2F6217398B1A00C15B6A /* mpmst.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = mpmst.h; sourceTree = "<group>"; }; | 1060 | 311F2F6217398B1A00C15B6A /* mpmst.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = mpmst.h; sourceTree = "<group>"; }; |
| 1061 | 311F2F6317398B1A00C15B6A /* mpmtypes.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = mpmtypes.h; sourceTree = "<group>"; }; | 1061 | 311F2F6317398B1A00C15B6A /* mpmtypes.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = mpmtypes.h; sourceTree = "<group>"; }; |
| 1062 | 311F2F6417398B1A00C15B6A /* mps.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = mps.h; sourceTree = "<group>"; }; | 1062 | 311F2F6417398B1A00C15B6A /* mps.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = mps.h; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; |
| 1063 | 311F2F6517398B3B00C15B6A /* mpsacl.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = mpsacl.h; sourceTree = "<group>"; }; | 1063 | 311F2F6517398B3B00C15B6A /* mpsacl.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = mpsacl.h; sourceTree = "<group>"; }; |
| 1064 | 311F2F6617398B3B00C15B6A /* mpsavm.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = mpsavm.h; sourceTree = "<group>"; }; | 1064 | 311F2F6617398B3B00C15B6A /* mpsavm.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = mpsavm.h; sourceTree = "<group>"; }; |
| 1065 | 311F2F6717398B3B00C15B6A /* mpsio.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = mpsio.h; sourceTree = "<group>"; }; | 1065 | 311F2F6717398B3B00C15B6A /* mpsio.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = mpsio.h; sourceTree = "<group>"; }; |
| @@ -1145,7 +1145,7 @@ | |||
| 1145 | 31EEAC2C156AB2F200714D05 /* message.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = message.c; sourceTree = "<group>"; }; | 1145 | 31EEAC2C156AB2F200714D05 /* message.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = message.c; sourceTree = "<group>"; }; |
| 1146 | 31EEAC2D156AB2F200714D05 /* poolmfs.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = poolmfs.c; sourceTree = "<group>"; }; | 1146 | 31EEAC2D156AB2F200714D05 /* poolmfs.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = poolmfs.c; sourceTree = "<group>"; }; |
| 1147 | 31EEAC2E156AB2F200714D05 /* poolmrg.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = poolmrg.c; sourceTree = "<group>"; }; | 1147 | 31EEAC2E156AB2F200714D05 /* poolmrg.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = poolmrg.c; sourceTree = "<group>"; }; |
| 1148 | 31EEAC2F156AB2F200714D05 /* poolmv.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = poolmv.c; sourceTree = "<group>"; }; | 1148 | 31EEAC2F156AB2F200714D05 /* poolmv.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; lineEnding = 0; path = poolmv.c; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.c; }; |
| 1149 | 31EEAC30156AB2F200714D05 /* ring.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ring.c; sourceTree = "<group>"; }; | 1149 | 31EEAC30156AB2F200714D05 /* ring.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ring.c; sourceTree = "<group>"; }; |
| 1150 | 31EEAC31156AB2F200714D05 /* sac.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = sac.c; sourceTree = "<group>"; }; | 1150 | 31EEAC31156AB2F200714D05 /* sac.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = sac.c; sourceTree = "<group>"; }; |
| 1151 | 31EEAC32156AB2F200714D05 /* shield.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = shield.c; sourceTree = "<group>"; }; | 1151 | 31EEAC32156AB2F200714D05 /* shield.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = shield.c; sourceTree = "<group>"; }; |
| @@ -1163,7 +1163,7 @@ | |||
| 1163 | 31EEAC53156AB3E300714D05 /* vmix.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = vmix.c; sourceTree = "<group>"; }; | 1163 | 31EEAC53156AB3E300714D05 /* vmix.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = vmix.c; sourceTree = "<group>"; }; |
| 1164 | 31EEAC5B156AB41900714D05 /* poolamc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = poolamc.c; sourceTree = "<group>"; }; | 1164 | 31EEAC5B156AB41900714D05 /* poolamc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = poolamc.c; sourceTree = "<group>"; }; |
| 1165 | 31EEAC5D156AB43F00714D05 /* poolsnc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = poolsnc.c; sourceTree = "<group>"; }; | 1165 | 31EEAC5D156AB43F00714D05 /* poolsnc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = poolsnc.c; sourceTree = "<group>"; }; |
| 1166 | 31EEAC5F156AB44D00714D05 /* poolmvff.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = poolmvff.c; sourceTree = "<group>"; }; | 1166 | 31EEAC5F156AB44D00714D05 /* poolmvff.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; lineEnding = 0; path = poolmvff.c; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.c; }; |
| 1167 | 31EEAC65156AB52600714D05 /* mpmss */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = mpmss; sourceTree = BUILT_PRODUCTS_DIR; }; | 1167 | 31EEAC65156AB52600714D05 /* mpmss */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = mpmss; sourceTree = BUILT_PRODUCTS_DIR; }; |
| 1168 | 31EEAC70156AB56000714D05 /* mpsioan.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mpsioan.c; sourceTree = "<group>"; }; | 1168 | 31EEAC70156AB56000714D05 /* mpsioan.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mpsioan.c; sourceTree = "<group>"; }; |
| 1169 | 31EEAC71156AB56000714D05 /* mpsliban.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mpsliban.c; sourceTree = "<group>"; }; | 1169 | 31EEAC71156AB56000714D05 /* mpsliban.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mpsliban.c; sourceTree = "<group>"; }; |
diff --git a/mps/code/mpscmfs.h b/mps/code/mpscmfs.h index a193cf507e9..734fa766d14 100644 --- a/mps/code/mpscmfs.h +++ b/mps/code/mpscmfs.h | |||
| @@ -9,8 +9,6 @@ | |||
| 9 | 9 | ||
| 10 | #include "mps.h" | 10 | #include "mps.h" |
| 11 | 11 | ||
| 12 | extern const struct mps_key_s _mps_key_mfs_extend_by; | ||
| 13 | #define MPS_KEY_MFS_EXTEND_BY (&_mps_key_mfs_extend_by) | ||
| 14 | extern const struct mps_key_s _mps_key_mfs_unit_size; | 12 | extern const struct mps_key_s _mps_key_mfs_unit_size; |
| 15 | #define MPS_KEY_MFS_UNIT_SIZE (&_mps_key_mfs_unit_size) | 13 | #define MPS_KEY_MFS_UNIT_SIZE (&_mps_key_mfs_unit_size) |
| 16 | 14 | ||
diff --git a/mps/code/mpscmv.h b/mps/code/mpscmv.h index 779c8b6d8e7..805db19b8af 100644 --- a/mps/code/mpscmv.h +++ b/mps/code/mpscmv.h | |||
| @@ -9,13 +9,6 @@ | |||
| 9 | 9 | ||
| 10 | #include "mps.h" | 10 | #include "mps.h" |
| 11 | 11 | ||
| 12 | extern const struct mps_key_s _mps_key_mv_extend_by; | ||
| 13 | #define MPS_KEY_MV_EXTEND_BY (&_mps_key_mv_extend_by) | ||
| 14 | extern const struct mps_key_s _mps_key_mv_avg_size; | ||
| 15 | #define MPS_KEY_MV_AVG_SIZE (&_mps_key_mv_avg_size) | ||
| 16 | extern const struct mps_key_s _mps_key_mv_max_size; | ||
| 17 | #define MPS_KEY_MV_MAX_SIZE (&_mps_key_mv_max_size) | ||
| 18 | |||
| 19 | extern size_t mps_mv_free_size(mps_pool_t mps_pool); | 12 | extern size_t mps_mv_free_size(mps_pool_t mps_pool); |
| 20 | extern size_t mps_mv_size(mps_pool_t mps_pool); | 13 | extern size_t mps_mv_size(mps_pool_t mps_pool); |
| 21 | extern mps_class_t mps_class_mv(void); | 14 | extern mps_class_t mps_class_mv(void); |
diff --git a/mps/code/mpscmvff.h b/mps/code/mpscmvff.h index b0660b8579c..6b13af35a22 100644 --- a/mps/code/mpscmvff.h +++ b/mps/code/mpscmvff.h | |||
| @@ -9,12 +9,6 @@ | |||
| 9 | 9 | ||
| 10 | #include "mps.h" | 10 | #include "mps.h" |
| 11 | 11 | ||
| 12 | extern const struct mps_key_s _mps_key_mvff_extend_by; | ||
| 13 | #define MPS_KEY_MVFF_EXTEND_BY (&_mps_key_mvff_extend_by) | ||
| 14 | extern const struct mps_key_s _mps_key_mvff_avg_size; | ||
| 15 | #define MPS_KEY_MVFF_AVG_SIZE (&_mps_key_mvff_avg_size) | ||
| 16 | extern const struct mps_key_s _mps_key_mvff_align; | ||
| 17 | #define MPS_KEY_MVFF_ALIGN (&_mps_key_mvff_align) | ||
| 18 | extern const struct mps_key_s _mps_key_mvff_slot_high; | 12 | extern const struct mps_key_s _mps_key_mvff_slot_high; |
| 19 | #define MPS_KEY_MVFF_SLOT_HIGH (&_mps_key_mvff_slot_high) | 13 | #define MPS_KEY_MVFF_SLOT_HIGH (&_mps_key_mvff_slot_high) |
| 20 | extern const struct mps_key_s _mps_key_mvff_arena_high; | 14 | extern const struct mps_key_s _mps_key_mvff_arena_high; |
diff --git a/mps/code/mpscmvt.h b/mps/code/mpscmvt.h index efc52b98e9e..b02c6173fb1 100644 --- a/mps/code/mpscmvt.h +++ b/mps/code/mpscmvt.h | |||
| @@ -9,12 +9,6 @@ | |||
| 9 | 9 | ||
| 10 | #include "mps.h" | 10 | #include "mps.h" |
| 11 | 11 | ||
| 12 | extern const struct mps_key_s _mps_key_mvt_min_size; | ||
| 13 | #define MPS_KEY_MVT_MIN_SIZE (&_mps_key_mvt_min_size) | ||
| 14 | extern const struct mps_key_s _mps_key_mvt_mean_size; | ||
| 15 | #define MPS_KEY_MVT_MEAN_SIZE (&_mps_key_mvt_mean_size) | ||
| 16 | extern const struct mps_key_s _mps_key_mvt_max_size; | ||
| 17 | #define MPS_KEY_MVT_MAX_SIZE (&_mps_key_mvt_max_size) | ||
| 18 | extern const struct mps_key_s _mps_key_mvt_reserve_depth; | 12 | extern const struct mps_key_s _mps_key_mvt_reserve_depth; |
| 19 | #define MPS_KEY_MVT_RESERVE_DEPTH (&_mps_key_mvt_reserve_depth) | 13 | #define MPS_KEY_MVT_RESERVE_DEPTH (&_mps_key_mvt_reserve_depth) |
| 20 | extern const struct mps_key_s _mps_key_mvt_frag_limit; | 14 | extern const struct mps_key_s _mps_key_mvt_frag_limit; |
diff --git a/mps/code/pool.c b/mps/code/pool.c index 70bc3e41548..ff31b09a8af 100644 --- a/mps/code/pool.c +++ b/mps/code/pool.c | |||
| @@ -110,6 +110,11 @@ Bool PoolCheck(Pool pool) | |||
| 110 | 110 | ||
| 111 | ARG_DEFINE_KEY(format, Format); | 111 | ARG_DEFINE_KEY(format, Format); |
| 112 | ARG_DEFINE_KEY(chain, Chain); | 112 | ARG_DEFINE_KEY(chain, Chain); |
| 113 | ARG_DEFINE_KEY(extend_by, Size); | ||
| 114 | ARG_DEFINE_KEY(min_size, Size); | ||
| 115 | ARG_DEFINE_KEY(mean_size, Size); | ||
| 116 | ARG_DEFINE_KEY(max_size, Size); | ||
| 117 | ARG_DEFINE_KEY(align, Align); | ||
| 113 | 118 | ||
| 114 | 119 | ||
| 115 | /* PoolInit -- initialize a pool | 120 | /* PoolInit -- initialize a pool |
diff --git a/mps/code/poolmfs.c b/mps/code/poolmfs.c index e4a9e15c7fc..4a33ed050a1 100644 --- a/mps/code/poolmfs.c +++ b/mps/code/poolmfs.c | |||
| @@ -81,7 +81,7 @@ Pool (MFSPool)(MFS mfs) | |||
| 81 | 81 | ||
| 82 | static void MFSVarargs(ArgStruct args[], va_list varargs) | 82 | static void MFSVarargs(ArgStruct args[], va_list varargs) |
| 83 | { | 83 | { |
| 84 | args[0].key = MPS_KEY_MFS_EXTEND_BY; | 84 | args[0].key = MPS_KEY_EXTEND_BY; |
| 85 | args[0].val.size = va_arg(varargs, Size); | 85 | args[0].val.size = va_arg(varargs, Size); |
| 86 | args[1].key = MPS_KEY_MFS_UNIT_SIZE; | 86 | args[1].key = MPS_KEY_MFS_UNIT_SIZE; |
| 87 | args[1].val.size = va_arg(varargs, Size); | 87 | args[1].val.size = va_arg(varargs, Size); |
| @@ -89,7 +89,6 @@ static void MFSVarargs(ArgStruct args[], va_list varargs) | |||
| 89 | AVER(ArgListCheck(args)); | 89 | AVER(ArgListCheck(args)); |
| 90 | } | 90 | } |
| 91 | 91 | ||
| 92 | ARG_DEFINE_KEY(mfs_extend_by, Size); | ||
| 93 | ARG_DEFINE_KEY(mfs_unit_size, Size); | 92 | ARG_DEFINE_KEY(mfs_unit_size, Size); |
| 94 | 93 | ||
| 95 | static Res MFSInit(Pool pool, ArgList args) | 94 | static Res MFSInit(Pool pool, ArgList args) |
| @@ -109,7 +108,7 @@ static Res MFSInit(Pool pool, ArgList args) | |||
| 109 | res = ResPARAM; | 108 | res = ResPARAM; |
| 110 | goto failParam; | 109 | goto failParam; |
| 111 | } | 110 | } |
| 112 | if (ArgPick(&arg, args, MPS_KEY_MFS_EXTEND_BY)) | 111 | if (ArgPick(&arg, args, MPS_KEY_EXTEND_BY)) |
| 113 | extendBy = arg.val.size; | 112 | extendBy = arg.val.size; |
| 114 | else { | 113 | else { |
| 115 | extendBy = MFS_EXTEND_BY_DEFAULT; | 114 | extendBy = MFS_EXTEND_BY_DEFAULT; |
diff --git a/mps/code/poolmv.c b/mps/code/poolmv.c index da2ce8d2e1b..50af068f4ed 100644 --- a/mps/code/poolmv.c +++ b/mps/code/poolmv.c | |||
| @@ -186,11 +186,11 @@ static Bool MVSpanCheck(MVSpan span) | |||
| 186 | 186 | ||
| 187 | static void MVVarargs(ArgStruct args[], va_list varargs) | 187 | static void MVVarargs(ArgStruct args[], va_list varargs) |
| 188 | { | 188 | { |
| 189 | args[0].key = MPS_KEY_MV_EXTEND_BY; | 189 | args[0].key = MPS_KEY_EXTEND_BY; |
| 190 | args[0].val.size = va_arg(varargs, Size); | 190 | args[0].val.size = va_arg(varargs, Size); |
| 191 | args[1].key = MPS_KEY_MV_AVG_SIZE; | 191 | args[1].key = MPS_KEY_MEAN_SIZE; |
| 192 | args[1].val.size = va_arg(varargs, Size); | 192 | args[1].val.size = va_arg(varargs, Size); |
| 193 | args[2].key = MPS_KEY_MV_MAX_SIZE; | 193 | args[2].key = MPS_KEY_MAX_SIZE; |
| 194 | args[2].val.size = va_arg(varargs, Size); | 194 | args[2].val.size = va_arg(varargs, Size); |
| 195 | args[3].key = MPS_KEY_ARGS_END; | 195 | args[3].key = MPS_KEY_ARGS_END; |
| 196 | AVER(ArgListCheck(args)); | 196 | AVER(ArgListCheck(args)); |
| @@ -206,10 +206,6 @@ static void MVDebugVarargs(ArgStruct args[], va_list varargs) | |||
| 206 | 206 | ||
| 207 | /* MVInit -- init method for class MV */ | 207 | /* MVInit -- init method for class MV */ |
| 208 | 208 | ||
| 209 | ARG_DEFINE_KEY(mv_extend_by, Size); | ||
| 210 | ARG_DEFINE_KEY(mv_avg_size, Size); | ||
| 211 | ARG_DEFINE_KEY(mv_max_size, Size); | ||
| 212 | |||
| 213 | static Res MVInit(Pool pool, ArgList args) | 209 | static Res MVInit(Pool pool, ArgList args) |
| 214 | { | 210 | { |
| 215 | Size extendBy = MV_EXTEND_BY_DEFAULT; | 211 | Size extendBy = MV_EXTEND_BY_DEFAULT; |
| @@ -222,11 +218,11 @@ static Res MVInit(Pool pool, ArgList args) | |||
| 222 | ArgStruct arg; | 218 | ArgStruct arg; |
| 223 | ArgStruct piArgs[3]; | 219 | ArgStruct piArgs[3]; |
| 224 | 220 | ||
| 225 | if (ArgPick(&arg, args, MPS_KEY_MV_EXTEND_BY)) | 221 | if (ArgPick(&arg, args, MPS_KEY_EXTEND_BY)) |
| 226 | extendBy = arg.val.size; | 222 | extendBy = arg.val.size; |
| 227 | if (ArgPick(&arg, args, MPS_KEY_MV_AVG_SIZE)) | 223 | if (ArgPick(&arg, args, MPS_KEY_MEAN_SIZE)) |
| 228 | avgSize = arg.val.size; | 224 | avgSize = arg.val.size; |
| 229 | if (ArgPick(&arg, args, MPS_KEY_MV_MAX_SIZE)) | 225 | if (ArgPick(&arg, args, MPS_KEY_MAX_SIZE)) |
| 230 | maxSize = arg.val.size; | 226 | maxSize = arg.val.size; |
| 231 | 227 | ||
| 232 | AVER(extendBy > 0); | 228 | AVER(extendBy > 0); |
| @@ -245,7 +241,7 @@ static Res MVInit(Pool pool, ArgList args) | |||
| 245 | blockExtendBy = sizeof(MVBlockStruct); | 241 | blockExtendBy = sizeof(MVBlockStruct); |
| 246 | } | 242 | } |
| 247 | 243 | ||
| 248 | piArgs[0].key = MPS_KEY_MFS_EXTEND_BY; | 244 | piArgs[0].key = MPS_KEY_EXTEND_BY; |
| 249 | piArgs[0].val.size = blockExtendBy; | 245 | piArgs[0].val.size = blockExtendBy; |
| 250 | piArgs[1].key = MPS_KEY_MFS_UNIT_SIZE; | 246 | piArgs[1].key = MPS_KEY_MFS_UNIT_SIZE; |
| 251 | piArgs[1].val.size = sizeof(MVBlockStruct); | 247 | piArgs[1].val.size = sizeof(MVBlockStruct); |
| @@ -256,7 +252,7 @@ static Res MVInit(Pool pool, ArgList args) | |||
| 256 | 252 | ||
| 257 | spanExtendBy = sizeof(MVSpanStruct) * (maxSize/extendBy); | 253 | spanExtendBy = sizeof(MVSpanStruct) * (maxSize/extendBy); |
| 258 | 254 | ||
| 259 | piArgs[0].key = MPS_KEY_MFS_EXTEND_BY; | 255 | piArgs[0].key = MPS_KEY_EXTEND_BY; |
| 260 | piArgs[0].val.size = spanExtendBy; | 256 | piArgs[0].val.size = spanExtendBy; |
| 261 | piArgs[1].key = MPS_KEY_MFS_UNIT_SIZE; | 257 | piArgs[1].key = MPS_KEY_MFS_UNIT_SIZE; |
| 262 | piArgs[1].val.size = sizeof(MVSpanStruct); | 258 | piArgs[1].val.size = sizeof(MVSpanStruct); |
diff --git a/mps/code/poolmv2.c b/mps/code/poolmv2.c index 186ee728b2c..203bf5a8e36 100644 --- a/mps/code/poolmv2.c +++ b/mps/code/poolmv2.c | |||
| @@ -195,11 +195,11 @@ static SegPref MVTSegPref(MVT mvt) | |||
| 195 | 195 | ||
| 196 | static void MVTVarargs(ArgStruct args[], va_list varargs) | 196 | static void MVTVarargs(ArgStruct args[], va_list varargs) |
| 197 | { | 197 | { |
| 198 | args[0].key = MPS_KEY_MVT_MIN_SIZE; | 198 | args[0].key = MPS_KEY_MIN_SIZE; |
| 199 | args[0].val.size = va_arg(varargs, Size); | 199 | args[0].val.size = va_arg(varargs, Size); |
| 200 | args[1].key = MPS_KEY_MVT_MEAN_SIZE; | 200 | args[1].key = MPS_KEY_MEAN_SIZE; |
| 201 | args[1].val.size = va_arg(varargs, Size); | 201 | args[1].val.size = va_arg(varargs, Size); |
| 202 | args[2].key = MPS_KEY_MVT_MAX_SIZE; | 202 | args[2].key = MPS_KEY_MAX_SIZE; |
| 203 | args[2].val.size = va_arg(varargs, Size); | 203 | args[2].val.size = va_arg(varargs, Size); |
| 204 | args[3].key = MPS_KEY_MVT_RESERVE_DEPTH; | 204 | args[3].key = MPS_KEY_MVT_RESERVE_DEPTH; |
| 205 | args[3].val.count = va_arg(varargs, Count); | 205 | args[3].val.count = va_arg(varargs, Count); |
| @@ -245,17 +245,17 @@ static Res MVTInit(Pool pool, ArgList args) | |||
| 245 | 245 | ||
| 246 | /* FIXME: Inconsistent reporting of bad arguments. Elsewhere we assert or return ResPARAM. */ | 246 | /* FIXME: Inconsistent reporting of bad arguments. Elsewhere we assert or return ResPARAM. */ |
| 247 | /* --- Should there be a ResBADARG ? */ | 247 | /* --- Should there be a ResBADARG ? */ |
| 248 | if (ArgPick(&arg, args, MPS_KEY_MVT_MIN_SIZE)) { | 248 | if (ArgPick(&arg, args, MPS_KEY_MIN_SIZE)) { |
| 249 | minSize = arg.val.size; | 249 | minSize = arg.val.size; |
| 250 | unless (minSize > 0) | 250 | unless (minSize > 0) |
| 251 | return ResLIMIT; | 251 | return ResLIMIT; |
| 252 | } | 252 | } |
| 253 | if (ArgPick(&arg, args, MPS_KEY_MVT_MEAN_SIZE)) { | 253 | if (ArgPick(&arg, args, MPS_KEY_MEAN_SIZE)) { |
| 254 | meanSize = arg.val.size; | 254 | meanSize = arg.val.size; |
| 255 | unless (meanSize >= minSize) | 255 | unless (meanSize >= minSize) |
| 256 | return ResLIMIT; | 256 | return ResLIMIT; |
| 257 | } | 257 | } |
| 258 | if (ArgPick(&arg, args, MPS_KEY_MVT_MAX_SIZE)) { | 258 | if (ArgPick(&arg, args, MPS_KEY_MAX_SIZE)) { |
| 259 | maxSize = arg.val.size; | 259 | maxSize = arg.val.size; |
| 260 | unless (maxSize >= meanSize) | 260 | unless (maxSize >= meanSize) |
| 261 | return ResLIMIT; | 261 | return ResLIMIT; |
diff --git a/mps/code/poolmvff.c b/mps/code/poolmvff.c index f8792bab783..ce6bf9cc9ae 100644 --- a/mps/code/poolmvff.c +++ b/mps/code/poolmvff.c | |||
| @@ -411,11 +411,11 @@ static void MVFFBufferEmpty(Pool pool, Buffer buffer, | |||
| 411 | 411 | ||
| 412 | static void MVFFVarargs(ArgStruct args[], va_list varargs) | 412 | static void MVFFVarargs(ArgStruct args[], va_list varargs) |
| 413 | { | 413 | { |
| 414 | args[0].key = MPS_KEY_MVFF_EXTEND_BY; | 414 | args[0].key = MPS_KEY_EXTEND_BY; |
| 415 | args[0].val.size = va_arg(varargs, Size); | 415 | args[0].val.size = va_arg(varargs, Size); |
| 416 | args[1].key = MPS_KEY_MVFF_AVG_SIZE; | 416 | args[1].key = MPS_KEY_MEAN_SIZE; |
| 417 | args[1].val.size = va_arg(varargs, Size); | 417 | args[1].val.size = va_arg(varargs, Size); |
| 418 | args[2].key = MPS_KEY_MVFF_ALIGN; | 418 | args[2].key = MPS_KEY_ALIGN; |
| 419 | args[2].val.align = va_arg(varargs, Size); /* promoted type */ | 419 | args[2].val.align = va_arg(varargs, Size); /* promoted type */ |
| 420 | args[3].key = MPS_KEY_MVFF_SLOT_HIGH; | 420 | args[3].key = MPS_KEY_MVFF_SLOT_HIGH; |
| 421 | args[3].val.b = va_arg(varargs, Bool); | 421 | args[3].val.b = va_arg(varargs, Bool); |
| @@ -437,9 +437,6 @@ static void MVFFDebugVarargs(ArgStruct args[], va_list varargs) | |||
| 437 | 437 | ||
| 438 | /* MVFFInit -- initialize method for MVFF */ | 438 | /* MVFFInit -- initialize method for MVFF */ |
| 439 | 439 | ||
| 440 | ARG_DEFINE_KEY(mvff_extend_by, Size); | ||
| 441 | ARG_DEFINE_KEY(mvff_avg_size, Size); | ||
| 442 | ARG_DEFINE_KEY(mvff_align, Align); | ||
| 443 | ARG_DEFINE_KEY(mvff_slot_high, Bool); | 440 | ARG_DEFINE_KEY(mvff_slot_high, Bool); |
| 444 | ARG_DEFINE_KEY(mvff_arena_high, Bool); | 441 | ARG_DEFINE_KEY(mvff_arena_high, Bool); |
| 445 | ARG_DEFINE_KEY(mvff_first_fit, Bool); | 442 | ARG_DEFINE_KEY(mvff_first_fit, Bool); |
| @@ -468,13 +465,13 @@ static Res MVFFInit(Pool pool, ArgList args) | |||
| 468 | /* .arg.check: we do the same checks here and in MVFFCheck */ | 465 | /* .arg.check: we do the same checks here and in MVFFCheck */ |
| 469 | /* except for arenaHigh, which is stored only in the segPref. */ | 466 | /* except for arenaHigh, which is stored only in the segPref. */ |
| 470 | 467 | ||
| 471 | if (ArgPick(&arg, args, MPS_KEY_MVFF_EXTEND_BY)) | 468 | if (ArgPick(&arg, args, MPS_KEY_EXTEND_BY)) |
| 472 | extendBy = arg.val.size; | 469 | extendBy = arg.val.size; |
| 473 | 470 | ||
| 474 | if (ArgPick(&arg, args, MPS_KEY_MVFF_AVG_SIZE)) | 471 | if (ArgPick(&arg, args, MPS_KEY_MEAN_SIZE)) |
| 475 | avgSize = arg.val.size; | 472 | avgSize = arg.val.size; |
| 476 | 473 | ||
| 477 | if (ArgPick(&arg, args, MPS_KEY_MVFF_ALIGN)) | 474 | if (ArgPick(&arg, args, MPS_KEY_ALIGN)) |
| 478 | align = arg.val.align; | 475 | align = arg.val.align; |
| 479 | 476 | ||
| 480 | if (ArgPick(&arg, args, MPS_KEY_MVFF_SLOT_HIGH)) | 477 | if (ArgPick(&arg, args, MPS_KEY_MVFF_SLOT_HIGH)) |