1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 18:40:39 -08:00

New macro mps_arg and revised macro mps_args_add mean that client programs no longer need to know which keyword argument goes in which field. revise documentation accordingly.

Copied from Perforce
 Change: 181736
 ServerID: perforce.ravenbrook.com
This commit is contained in:
Gareth Rees 2013-05-12 17:21:03 +01:00
parent eaad4493d4
commit cce6ee29c8
34 changed files with 322 additions and 275 deletions

View file

@ -4471,7 +4471,7 @@ int main(int argc, char *argv[])
/* Create an MPS arena. There is usually only one of these in a process.
It holds all the MPS "global" state and is where everything happens. */
res = mps_arena_create_k(&arena, mps_arena_class_vm(),
(mps_arg_s[]){{MPS_KEY_ARENA_SIZE, .val.size = 32 * 1024 * 1024},
(mps_arg_s[]){MPS_ARG(MPS_KEY_ARENA_SIZE, 32 * 1024 * 1024),
{MPS_KEY_ARGS_END}});
if (res != MPS_RES_OK) error("Couldn't create arena");
@ -4489,8 +4489,8 @@ int main(int argc, char *argv[])
/* Create an Automatic Mostly-Copying (AMC) pool to manage the Scheme
objects. This is a kind of copying garbage collector. */
res = mps_pool_create_k(&obj_pool, arena, mps_class_amc(),
(mps_arg_s[]){{MPS_KEY_CHAIN, .val.chain = obj_chain},
{MPS_KEY_FORMAT, .val.format = obj_fmt},
(mps_arg_s[]){MPS_ARG(MPS_KEY_CHAIN, obj_chain),
MPS_ARG(MPS_KEY_FORMAT, obj_fmt),
{MPS_KEY_ARGS_END}});
if (res != MPS_RES_OK) error("Couldn't create obj pool");
@ -4504,8 +4504,8 @@ int main(int argc, char *argv[])
/* Create an Automatic Mostly-Copying Zero-rank (AMCZ) pool to
manage the leaf objects. */
res = mps_pool_create_k(&leaf_pool, arena, mps_class_amcz(),
(mps_arg_s[]){{MPS_KEY_CHAIN, .val.chain = obj_chain},
{MPS_KEY_FORMAT, .val.format = obj_fmt},
(mps_arg_s[]){MPS_ARG(MPS_KEY_CHAIN, obj_chain),
MPS_ARG(MPS_KEY_FORMAT, obj_fmt),
{MPS_KEY_ARGS_END}});
if (res != MPS_RES_OK) error("Couldn't create leaf pool");
@ -4520,19 +4520,19 @@ int main(int argc, char *argv[])
/* Create an Automatic Weak Linked (AWL) pool to manage the hash table
buckets. */
res = mps_pool_create_k(&buckets_pool, arena, mps_class_awl(),
(mps_arg_s[]){{MPS_KEY_FORMAT, .val.format = buckets_fmt},
{MPS_KEY_AWL_FIND_DEPENDENT,
.val.addr_method = buckets_find_dependent},
(mps_arg_s[]){MPS_ARG(MPS_KEY_FORMAT, buckets_fmt),
MPS_ARG(MPS_KEY_AWL_FIND_DEPENDENT,
buckets_find_dependent),
{MPS_KEY_ARGS_END}});
if (res != MPS_RES_OK) error("Couldn't create buckets pool");
/* Create allocation points for weak and strong buckets. */
res = mps_ap_create_k(&strong_buckets_ap, buckets_pool,
(mps_arg_s[]){{MPS_KEY_RANK, .val.rank = mps_rank_exact()},
(mps_arg_s[]){MPS_ARG(MPS_KEY_RANK, mps_rank_exact()),
{MPS_KEY_ARGS_END}});
if (res != MPS_RES_OK) error("Couldn't create strong buckets allocation point");
res = mps_ap_create_k(&weak_buckets_ap, buckets_pool,
(mps_arg_s[]){{MPS_KEY_RANK, .val.rank = mps_rank_weak()},
(mps_arg_s[]){MPS_ARG(MPS_KEY_RANK, mps_rank_weak()),
{MPS_KEY_ARGS_END}});
if (res != MPS_RES_OK) error("Couldn't create weak buckets allocation point");