Coder Social home page Coder Social logo

Comments (6)

benmwatson avatar benmwatson commented on September 23, 2024 2

This is something that has come up every so often, and I'm thinking about it. One of the issues would be taking this farther from the underlying MemoryStream interface that we try to adhere to, but I think it's reasonable to consider moving beyond it.

from microsoft.io.recyclablememorystream.

benmwatson avatar benmwatson commented on September 23, 2024 1

@pengchen0692 @paulomorgado I have submitted a PR to open the size limits. I'm curious what you think.

from microsoft.io.recyclablememorystream.

benmwatson avatar benmwatson commented on September 23, 2024

Just an update on this: I am working on code changes for this request, as time allows. It isn't a trivial change, unfortunately, and will constitute a breaking change in the library (ints changing to longs in a few public places). There are also a lot of unit tests that need to be added.

I also have to decide how to handle things like multi-GB streams. .NET still has maximum array sizes. So even if you can have a stream that is 1 TB in length (with thousands of blocks), you can't call GetBuffer on that. Lots of little details like that.

from microsoft.io.recyclablememorystream.

paulomorgado avatar paulomorgado commented on September 23, 2024

A way to not introduce breaking changes is to introduce overloads for both int and long, where possible.

It the stream length goes beyond the maximum array size, GetBuffer() should throw an InvalidOperationException.

But I don't know if managed memory is the best option for more than 2GiB. At that point, it might be a good option to go with unmanaged memory.

Unmanaged memory might be a good option for the pools of RMS even from smaller sizes.

from microsoft.io.recyclablememorystream.

benmwatson avatar benmwatson commented on September 23, 2024

At the beginning, I was considering adding overloads. I think I assumed it would just be too messy, but it probably didn't end up being so. I'll rethink this.

I'll change GetBuffer.

I think unmanaged buffers might be a bridge too far at this point. That would dramatically change the implementation, and could potentially restrict the users of the library, but I'll keep that in mind.

from microsoft.io.recyclablememorystream.

paulomorgado avatar paulomorgado commented on September 23, 2024

Unmanaged buffers would, definitely, be a whole new implementation.

We might get away with the same implementation for the stream but with a different manager.

from microsoft.io.recyclablememorystream.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.