Ensure room for at least n entries without further reallocation.
Existing entries are preserved. Capacity never shrinks, so a request smaller than or equal to the current capacity is a no-op.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(heap_t), | intent(inout) | :: | self | |||
| integer(kind=default_int), | intent(in) | :: | n |
subroutine heap_reserve(self, n) !! Ensure room for at least `n` entries without further reallocation. !! !! Existing entries are preserved. Capacity never shrinks, so a request !! smaller than or equal to the current capacity is a no-op. class(heap_t), intent(inout) :: self integer(default_int), intent(in) :: n if (n <= self%capacity()) return call grow_int64(self%keys, self%n_entries, n) call grow_int32(self%payloads, self%n_entries, n) call grow_int64(self%insertion, self%n_entries, n) end subroutine heap_reserve