Ambiguous interior pointers now keep objects in AMC (Automatic Mostly-Copying) and AMCZ (Automatic Mostly-Copying Zero-rank) pools alive.
This means that if the compiler optimizes away a pointer to the base of an object, leaving an interior pointer as the only reference keeping the object alive, this does not cause the object to be incorrectly collected. Or, if you are writing your own compiler, you can now perform such an optimization safely.
If you require the old behaviour (in which ambiguous interior pointers were ignored) then you can set the MPS_KEY_INTERIOR keyword argument to FALSE when calling mps_pool_create_k().
The logic for deciding which generations should be collected has changed. Now, a chain may be scheduled for collection if the new size of any of its generations exceeds its capacity, and when a chain is collected, all generations are collected up to, and including, the highest generation whose new size exceeds its capacity. This ensures that all generations are collected reliably on chains where there is no allocation into the nursery generation. See Scheduling of collections.
(Previously, only the nursery generation in each chain was considered, and a chain was collected up to, but not including, the lowest generation whose new size was within its capacity.)
As a result of this change, we recommend that you retune your generation sizes. (This is not necessary, but may improve performance.)
New pool introspection functions mps_pool_total_size() and mps_pool_free_size().
In previous releases there was an implicit connection between blocks allocated by AWL (Automatic Weak Linked) and LO (Leaf Object) pools, and blocks allocated by other automatically managed pool classes.
In particular, blocks allocated by AWL and LO pools were garbage collected together with blocks allocated by AMS (Automatic Mark and Sweep) pools, and blocks allocated by AMC (Automatic Mostly-Copying) pools in generation 1 of their chains.
This is no longer the case: to arrange for blocks to be collected together you need to ensure that they are allocated in the same generation chain, using the MPS_KEY_CHAIN and MPS_KEY_GEN keyword arguments to mps_pool_create_k().
So if you have code like this:
res = mps_pool_create(&my_amc, arena, mps_class_amc(), my_chain);
res = mps_pool_create(&my_awl, arena, mps_class_awl());
and you want to retain the connection between these pools, then you must ensure that they use the same generation chain:
MPS_ARGS_BEGIN(args) {
MPS_ARGS_ADD(args, MPS_KEY_CHAIN, my_chain);
res = mps_pool_create_k(&my_amc, arena, mps_class_amc(), args);
} MPS_ARGS_END(args);
MPS_ARGS_BEGIN(args) {
MPS_ARGS_ADD(args, MPS_KEY_CHAIN, my_chain);
MPS_ARGS_ADD(args, MPS_KEY_GEN, 1);
res = mps_pool_create_k(&my_awl, arena, mps_class_awl(), args);
} MPS_ARGS_END(args);
In the hot (production) variety, the default assertion handler now prints messages to standard error but does not terminate the program. Even though assertions indicate serious problems in the program, an end-user does not always want an application to terminate when there is a chance to shut down safely and save work, or even to limp along indefinitely. See Assertion handling.
The behaviour when an assertion is triggered is now configurable in the standard ANSI plinth by installing an assertion handler. See mps_lib_assert_fail_install().
Functions that take a variable number of arguments (mps_arena_create(), mps_pool_create(), mps_ap_create()) and their va_list alternatives (mps_arena_create_v() etc.) are now deprecated in favour of functions that use a keyword argument interface (mps_arena_create_k(), mps_pool_create_k(), mps_ap_create_k()).
Similarly, the object format variant structures (mps_fmt_A_s etc.) and the functions that take them as arguments (mps_fmt_create_A() etc.) are now deprecated in favour of mps_fmt_create_k().
The new interfaces provide better reporting of errors, default values for arguments, and forward compatibility. See Keyword arguments.
The old interfaces continue to be supported for now, but new features will become available through the keyword interface only.
MFS (Manual Fixed Small) pools no longer refuse to manage blocks that are smaller than the platform alignment. They now round up smaller sizes internally if necessary.
MVT (Manual Variable Temporal) pools now allow the client to specify the alignment of blocks. Use the keyword argument MPS_KEY_ALIGN when creating a pool of class mps_class_mvt().
On OS X, signals are no longer used for handling memory protection exceptions. This means that programs are free to handle SIGBUS, but must not install a thread-local Mach exception handler for EXC_BAD_ACCESS exceptions. See Signal and exception handling issues.
On OS X, when debugging with gdb, you no longer need to turn on dont-handle-bad-access or to request special handling of SIGBUS.