mpn_ctx_fit_buffer_reserve, mpn_ctx_fit_buffer_release
#include <flint/fft_small.h>Reserves the tail of the scratch buffer: the buffer is grown to hold head plus tail bytes (each rounded up to 4096), and the returned pointer to the last tail bytes stays valid until the release. Returns NULL if a reservation is already live. Reserving, like any growth, invalidates a pointer returned by mpn_ctx_fit_buffer.
A reservation is meant for a caller that keeps transformed operands alive across many operations on one thread, such as an operand pool (fft_small_op_pool_fit with FFT_SMALL_OP_POOL_RESERVE) and through it the transformed integer rings of gr. While it is live, multiplications on the same thread still work: requests that do not fit in the head are served from the secondary buffer, at the cost of an allocation.
The FLINT team, “mpn_ctx_fit_buffer_reserve, mpn_ctx_fit_buffer_release (fft_small.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/fft_small/mpn_ctx_fit_buffer_reserve.html (generated 2026-10-20).
@misc{flint-doc-fft-small-mpn-ctx-fit-buffer-reserve,
author = {{The FLINT team}},
title = {{mpn\_ctx\_fit\_buffer\_reserve, mpn\_ctx\_fit\_buffer\_release (fft\_small.h)}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/fft_small/mpn_ctx_fit_buffer_reserve.html},
note = {Generated 2026-10-20}
}