On Sat, 16 Oct 2010 01:25:35 +0400, Kagamin <s...@here.lot> wrote:
Denis Koroskin Wrote:
ubyte[] read() and ubyte[] read(size_t size) both require buffering
(e.g.
BufferedStream adapter). As such, it can provide stronger guaranties
over
raw streams.
What do you plan to do if user requests too much data from
BufferedStream?
Allocate, read, return.
Ideally stream can allocate big buffer and store it in a weak pointer
for it to be both memory and allocation-wise, but we don't have weak
pointers, do we?
I don't see anything that would prevent weak references from working. I'm
storing some of my pointers as size_t, and they are being
garbage-collected like intended (dtor updates dead reference). I will try
implementing WeakRef template and see how it turns out later.