On Wednesday, 5 February 2014 at 21:00:32 UTC, Adam D. Ruppe
wrote:
On Wednesday, 5 February 2014 at 20:46:32 UTC, Johannes Pfau
wrote:
However, I wonder if that's really a problem in phobos. I'd
guess most functions accepting slice input don't store a
reference.
We should probably start documenting that. (Or finish 'scope'
as you already said implicitly ;-).
Aye. If the reference never escapes, it doesn't need to be
counted or freed (indeed, it really MUST never be freed, since
whomever passed you that reference may still be using it and is
responsible for freeing it (or passing the buck to the GC))
I wonder if passing it in as "scope" could be utilized in some
way to forgo reference count increments/decrements.