AutoPreallocation.freeze
— Methodfreeze(record)
Freezes an allocation record
, to not allow new allocations to be added. This converts the memory of the what happenned to be stored as a Tuple
. This could give better performance during replay; or it could give worse.
AutoPreallocation.preallocate
— Methodpreallocate(f, xs...)
Return the first run result and a preallocated version of the corresponding method of callable object f
given its argument. Note the behaviour of both the method generated record and the method will be freezed, you shouldn't feed this function with a dynamic allocation method.
AutoPreallocation.reinitialize!
— Methodreinitialize!(record)
Reset all arrays in the allocation record
back to their initial sizes.
AutoPreallocation.reinitialize!
— Methodreinitialize!(replay::AllocationReplay)
Return all recorded allocations to original sizes, and reset to first step.
AutoPreallocation.@no_prealloc
— Macro@no_prealloc(expr)
Anything inside a @no_prealloc
will be ignored by AutoPreallocation.jl. This applies recursively to functions called by functions called etc within the @no_prealloc
. If it allocates then that allocation will always occur – it won't be avoided by auto-preallocation.
This can be used if there is a part of a function that may allocation a unknowable number of intermediary variables to get to the final answer – and which thus is not suitable for use with AutoPreallocation.