This sounds a lot like having an allocator as a parameter object a la Scheme[0]. Really cool!
[0] https://standards.scheme.org/corrected-r7rs/r7rs-Z-H-6.html#...