Version: 4.1.0
Date: 2025-12-18
SPDX-License-Identifier: BSD-3-Clause
License File: See the LICENSE file in the project root
Copyright: © 2025 Michael Gardner, A Bit of Help, Inc.
Status: Released
The Functional library is 100% embedded-safe with ZERO heap allocations. All types (Result<T,E>, Option<T>, Either<L,R>) use stack-based discriminated records.
The library source code does NOT contain pragma Restrictions to allow testing with AUnit (which uses recursion). Instead, your application should apply the restrictions.
cp functional/config/embedded_restrictions.adc ./gnat.adc
alr build # Restrictions applied automaticallyproject My_App is
package Compiler is
for Local_Configuration_Pragmas use
"../functional/config/embedded_restrictions.adc";
end Compiler;
end My_App;alr exec -- gprbuild -gnatec=functional/config/embedded_restrictions.adcThe embedded_restrictions.adc file applies:
Heap Safety:
No_Allocators- No explicit "new"No_Implicit_Heap_Allocations- No hidden heap useNo_Anonymous_Allocators- No anonymous access with newNo_Coextensions- No discriminant allocationsNo_Local_Allocators- No local pool allocations
Additional Safety:
No_Finalization- No controlled typesNo_Nested_Finalization- No nested controlled typesNo_Recursion- Stack safety (no unbounded growth)
The library is designed to comply with these restrictions. To verify:
alr exec -- gprbuild -P functional.gpr \
-gnatec=config/embedded_restrictions.adcIf this builds successfully, the library complies.
This is standard Ada library practice:
- Library: Compatible with restrictions (source unrestricted)
- Tests: Can use AUnit (needs recursion)
- Applications: Choose their own restriction policy
- Verification: Release process checks compliance
See docs/EMBEDDED_RESTRICTIONS_SOLUTION.md (in zoneinfo project) for detailed explanation.