Extend Gaudi::Arena::Monotonic to support [optional, basic] non-monotonic behaviour
(as hinted by the name, I think this feature should come under a different name -- but it should be able to share the code)
The following discussion from !1026 (merged) should be addressed:
-
@graven started a discussion: (+1 comment) there is exactly one case where you may want to actually do something on
deallocate
and that is to support the case where the caller asks for some memory, uses it, and then returns it, without there having been any other allocation between the two calls. Basically, if the pointer+size you get here (adjusted for alignment) equals the high-water mark, then you can just decrease the high water mark...The price of supporting this is exactly one
if
statement on every de-allocation instead of a no-op... which a-priori will be a loss, until the case comes along where this will actually be used. So maybe this is something that should be part of a 'policy' for the arena, so that this behavior can be selected (or not) at compile time...