https://github.com/sciml/resettablestacks.jl
A stack implementation with a reset! function which avoids garbage collection for scientific machine learning (SciML)
https://github.com/sciml/resettablestacks.jl
data-structures scientific-machine-learning sciml
Last synced: about 1 month ago
JSON representation
A stack implementation with a reset! function which avoids garbage collection for scientific machine learning (SciML)
- Host: GitHub
- URL: https://github.com/sciml/resettablestacks.jl
- Owner: SciML
- License: other
- Created: 2016-06-14T21:29:38.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2025-08-18T13:00:49.000Z (about 2 months ago)
- Last Synced: 2025-08-28T17:51:13.516Z (about 2 months ago)
- Topics: data-structures, scientific-machine-learning, sciml
- Language: Julia
- Homepage: https://sciml.ai/
- Size: 67.4 KB
- Stars: 7
- Watchers: 2
- Forks: 9
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
- Citation: CITATION.bib
Awesome Lists containing this project
README
# ResettableStacks
[](https://github.com/SciML/ResettableStacks.jl/actions?query=workflow%3ACI)
[](http://pkg.julialang.org/?pkg=ResettableStacks)
[](http://pkg.julialang.org/?pkg=ResettableStacks)A ResettableStack is a stack implementation which has a `reset!` function which
will "reset" the stack, allowing it to write over its previous data. This
allows you to reset the stack while avoiding garbage collection which can greatly
improve performance in certain use cases. Every `FULL_RESET_COUNT` resets, it
does a full reset, which is useful if the stack got very large for some reason
and it no longer needs to be that large (while minimizing garbage control costs).## Installation
To install the package, simply use:
```julia
Pkg.add("ResettableStacks")
using ResettableStacks
```For the latest version, checkout master via:
```julia
Pkg.checkout("ResettableStacks")
```## Usage
```julia
using ResettableStacks
S = ResettableStack{}(Tuple{Float64, Float64, Float64})push!(S, (0.5, 0.4, 0.3))
push!(S, (0.5, 0.4, 0.4))
reset!(S)
push!(S, (0.5, 0.4, 0.3))
tup = pop!(S)
```