GCC Newspaper
JUNE 15, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
alloc-pool

alloc-pool: Allow non-default constructors.

The object_allocator now supports allocating objects using non-default constructors.

The object_allocator in alloc-pool has been generalized to support allocation using non-default constructors. This provides more flexibility when creating objects within the allocation pool allowing more complex object initialization. This enhancement mirrors functionality in rtl-ssa for obstack allocations and paves the way for upcoming backprop patches.

In Details

The object_allocator in alloc-pool.h previously only supported default constructors. This commit modifies the allocate method to allow for the use of non-default constructors. This change is similar to how rtl-ssa handles obstack allocations. This is relevant to use cases like Robin's backprop patch.

For Context

Memory allocation is a fundamental part of software development. Alloc-pool is a memory allocation facility within GCC. This commit enhances the object allocator to allow the use of constructors with arguments when creating objects, providing more control over object initialization.

Filed Under: memory allocationconstructoralloc-pool