README.md
April 12, 2026 ยท View on GitHub
FARENA - Simple Fortran Arena Allocator for Intrinsic Arrays
supported type(kind)
i32 => integer(kind=c_int32_t)
i64 => integer(kind=c_int64_t)
sp => real(kind=c_float)
dp => real(kind=c_double)
Returned pointers must all be marked contiguous.
public API:
type(arena_type)
=> init([size_i32, size_i64, size_sp, size_dp]) ! default size will hold 1 GB, optional 32-bit integers for maximum size
=> init64([size_i32, size_i64, size_sp, size_dp]) ! default size will hold 1 GB, optional 64-bit integers for maximum size
=> reset() ! reset internal counter to reuse the same arena
=> free() ! explicitly deallocate arena's memory
=> gptr(dim1, dim2, ..., dimN, ptr) ! return N-D pointer to arrays of intrinsic types
! supports i32, i64, sp, dp
! supports rank 1-15 arrays
! rank 1 arrays specified by 32/64-bit integer dimension
! rank 2-15 specified by 32-bit integer dimensions
Primary module farena.f90. See example_program.f90 for usage.