Release notes

Release 1.114.0

New features

  1. 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().

  2. 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.)

  3. New pool introspection functions mps_pool_total_size() and mps_pool_free_size().

Interface changes

  1. The granularity with which the arena manages memory can now be specified using the MPS_KEY_ARENA_GRAIN_SIZE keyword argument to mps_arena_create_k(). See mps_arena_class_cl() and mps_arena_class_vm().

  2. There is now a default value (currently 256 megabytes) for the MPS_KEY_ARENA_SIZE keyword argument to mps_arena_create_k() when creating a virtual memory arena. See mps_arena_class_vm().

  3. The keyword argument MPS_KEY_AMS_SUPPORT_AMBIGUOUS now defaults to TRUE in order to better support the general case: the value FALSE is appropriate only when you know that all references are exact. See AMS (Automatic Mark and Sweep).

  4. There is now a default value for the MPS_KEY_AWL_FIND_DEPENDENT keyword argument to mps_pool_create_k() when creating an AWL (Automatic Weak Linked) pool. The default value is a function that always returns NULL (meaning that there is no dependent object).

  5. It is now possible to configure the alignment of objects allocated in a MV (Manual Variable) pool, by passing the MPS_KEY_ALIGN keyword argument to mps_pool_create_k().

  6. The MVFF (Manual Variable First Fit) pool class takes a new keyword argument MPS_KEY_SPARE. This specifies the maximum proportion of memory that the pool will keep spare for future allocations.

  7. The alignment requirements for MVFF (Manual Variable First Fit) and MVT (Manual Variable Temporal) pools have been relaxed on the platforms w3i3mv and w3i6mv. On all platforms it is now possible to specify alignments down to sizeof(void*) as the alignment for pools of these classes.

  8. The sizes of the templates in a mps_pool_debug_option_s structure no longer have to be related to the alignment of the pools that they are used with. This makes it easier to reuse these structures.

Other changes

  1. The AMS (Automatic Mark and Sweep) pool class no longer triggers the assertion !AMS_IS_INVALID_COLOUR(seg, i) under rare circumstances (namely, detaching an allocation point from a grey segment when MPS_KEY_AMS_SUPPORT_AMBIGUOUS is FALSE). See job001549.

  2. mps_arena_roots_walk() no longer triggers an assertion failure when run twice in succession. See job003496.

  3. The alignment of AWL (Automatic Weak Linked) pools is now configurable via the object format, as documented, and is no longer always MPS_PF_ALIGN. See job003745.

  4. The debugging version of the MVFF (Manual Variable First Fit) pool class, mps_class_mvff_debug(), no longer triggers an assertion failure if you allocate a large object. See job003751.

  5. mpseventtxt now successfully processes a telemetry log containing multiple labels associated with the same address. See job003756.

  6. AMS (Automatic Mark and Sweep), AWL (Automatic Weak Linked) and LO (Leaf Object) pools get reliably collected, even in the case where the pool is the only pool on its generation chain and is allocating into some generation other than the nursery. See job003771.

  7. Allocation into AWL (Automatic Weak Linked) pools again reliably provokes garbage collections of the generation that the pool belongs to. (In release 1.113.0, the generation would only be collected if a pool of some other class allocated into it.) See job003772.

  8. All unreachable objects in LO (Leaf Object) pools are finalized. (Previously, objects on a segment attached to an allocation point were not finalized until the allocation point was full.) See job003773.

  9. The MVT (Manual Variable Temporal) and MVFF (Manual Variable First Fit) pool classes are now around 25% faster (in our benchmarks) than they were in release 1.113.0.

  10. The default assertion handler in the ANSI plinth now flushes the telemetry stream before aborting. See mps_lib_assert_fail().

Release 1.113.0

New features

  1. 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);

Interface changes

  1. When creating a list of keyword arguments, there is no longer any need to call MPS_ARGS_DONE(). See Keyword arguments.

  2. When creating an automatically managed pool using mps_pool_create_k(), it is no longer necessary to pass in a generation chain. The arena has a default generation chain and this is used by all automatically managed pools where no generation chain was specified.

  3. It is now possible to specify a generation chain for AWL (Automatic Weak Linked) and LO (Leaf Object) pool classes, by using the optional MPS_KEY_CHAIN keyword argument to mps_pool_create_k().

  4. It is now possible to specify which generation the AMS (Automatic Mark and Sweep), AWL (Automatic Weak Linked), and LO (Leaf Object) pool classes allocate new objects into, using the optional MPS_KEY_GEN keyword argument to mps_pool_create_k().

Other changes

  1. The MPS now retains some unused memory instead of returning it to the operating system. This reduces unnecessary overhead due to system calls, thrashing the operating system’s page table, and zeroing memory when re-allocated. See job003700.

Release 1.112.0

New features

  1. New supported platform lii6ll (Linux, x86-64, Clang/LLVM).

  2. On Windows, you can now request that the MPS allocate address space from the top down, allowing a 32-bit executable linked with /LARGEADDRESSAWARE to use the top half of the address space. Use the keyword argument MPS_KEY_VMW3_TOP_DOWN when creating an arena of class mps_arena_class_vm().

  3. On OS X, multi-threaded programs are now supported. See Threads.

  4. On OS X, you can now debug the MPS using lldb.

Interface changes

  1. 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.

  2. 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().

  3. 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.

  4. 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.

  5. 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().

  6. 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.

  7. 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.

Other changes

  1. On Windows, an execute exception no longer triggers an assertion. See job003301.

  2. Rehashing of large address-based hash tables no longer provokes a nursery collection that immediately renders the hash table stale again. See job003435.

  3. An MVT (Manual Variable Temporal) pool no longer triggers an assertion failure when it runs out of space on its reserved block queue. See job003486.

  4. The -i and -o options no longer cause mpseventsql to crash. See job003507.

  5. On Windows, telemetry files now have correct clock values. Previously the top 32 bits were incorrectly output as zero. See job003519.

  6. On 64-bit Windows, it’s no longer possible to get a stack overflow exception while the MPS is holding the arena lock. See job003640.

Release 1.111.0

New features

  1. Reporting features have been removed from the mpseventcnv utility. Instead, the telemetry system comes with two new utility programs to assist with reporting and analysis: mpseventtxt converts an event stream into human-readable form, and mpseventsql loads an event stream into a SQLite database for further analysis. See Telemetry.

  2. The new pool class MFS (Manual Fixed Small) provides manually managed allocation of fixed-size objects.

  3. The new pool class MVT (Manual Variable Temporal) provides manually managed allocation of variable-size objects using a temporal fit allocation policy (that is, objects that are allocated togther are expected to be freed together).

Interface changes

  1. It is no longer necessary for client programs to use mps_tramp() to ensure that exceptions due to barrier hits are caught. This function is now deprecated.

  2. You can set the environment variable MPS_TELEMETRY_CONTROL to all to make the telemetry system output all events. See Telemetry.

  3. New functions mps_telemetry_get(), mps_telemetry_set() and mps_telemetry_reset() provide a more convenient interface to telemetry control than mps_telemetry_control(), which is now deprecated. See Telemetry.

  4. The pool classes MV (Manual Variable) and SNC (Stack No Checking) are now deprecated.

  5. Allocation frames are now deprecated. See Allocation frames.

  6. Additionally, the functions mps_arena_expose(), mps_arena_unsafe_expose_remember_protection(), mps_arena_unsafe_restore_protection(), mps_arena_roots_walk(), and mps_fix() are now deprecated.

Other changes

  1. mps_arena_step() no longer unclamps the arena as a side effect. If the arena is clamped or parked before calling mps_arena_step(), it is clamped afterwards. See job003320.

  2. The ambiguous stack scanner, mps_stack_scan_ambig(), no longer asserts on Linux when there are multiple threads. See job003412.

  3. It is no longer possible for the “ramp” allocation pattern, mps_alloc_pattern_ramp(), to get stuck. Now mps_ap_alloc_pattern_end() reliably clears this pattern. See job003454.

  4. The build system now correctly detects the FreeBSD operating system running on the x86-64 architecture, for FreeBSD version 9.1 or later. See job003473.