From ecd974df8fc48622d3b49ab2c67ea20c3384cda4 Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Tue, 1 Oct 2013 15:11:39 +0100 Subject: [PATCH] Bring guide up to date by using mps_fmt_create_k instead of mps_fmt_create in the exaple code. Copied from Perforce Change: 183509 ServerID: perforce.ravenbrook.com --- mps/manual/source/guide/lang.rst | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/mps/manual/source/guide/lang.rst b/mps/manual/source/guide/lang.rst index 3069d8cf6c9..f241d7fbf5e 100644 --- a/mps/manual/source/guide/lang.rst +++ b/mps/manual/source/guide/lang.rst @@ -735,18 +735,16 @@ the pool creation code. First, the header for the AMC pool class:: Second, the :term:`object format`:: - struct mps_fmt_A_s obj_fmt_s = { - sizeof(mps_word_t), - obj_scan, - obj_skip, - NULL, - obj_fwd, - obj_isfwd, - obj_pad, - }; - - mps_fmt_t obj_fmt; - res = mps_fmt_create_A(&obj_fmt, arena, &obj_fmt_s); + MPS_ARGS_BEGIN(args) { + MPS_ARGS_ADD(args, MPS_KEY_FMT_ALIGN, ALIGNMENT); + MPS_ARGS_ADD(args, MPS_KEY_FMT_SCAN, obj_scan); + MPS_ARGS_ADD(args, MPS_KEY_FMT_SKIP, obj_skip); + MPS_ARGS_ADD(args, MPS_KEY_FMT_FWD, obj_fwd); + MPS_ARGS_ADD(args, MPS_KEY_FMT_ISFWD, obj_isfwd); + MPS_ARGS_ADD(args, MPS_KEY_FMT_PAD, obj_pad); + MPS_ARGS_DONE(args); + res = mps_fmt_create_k(&obj_fmt, arena, args); + } MPS_ARGS_END(args); if (res != MPS_RES_OK) error("Couldn't create obj format"); Third, the :term:`generation chain`::