{"push_id":815147866,"size":1,"distinct_size":1,"ref":"refs/heads/master","head":"1b9869d80ff3a08978a0dc08e0894873a67a2570","before":"63b9f07bd9d2da0d1a8bd0f0cfe25ff032c6c20e","commits":[{"sha":"1b9869d80ff3a08978a0dc08e0894873a67a2570","author":{"email":"bb66f84aea4a8b0640e90635f71156cd34d40dc9@microsoft.com","name":"sanjeevm0"},"message":"Always use MemoryStreamB and reduce memory usage\n\nChange to always using MemoryStreamB, although StreamBaseByte can once again be used now.\nAlways use replication for memory stream as memory stream now implements IDisposable.\nStandard usage is following:\n\nuse ms = new MemStream(...) // allocate a new MemStream\nuse ms = Function(...) // if Function returns a MemStream\n\nIf function returns MemStream then use following to create MemStream to return\n(caller of function will then use: \"use ms = Function(...)\":\n\nlet ms = new MemStream(...)\n\nIf MemStream is passed to a function, then if function needs MemStream after it returns,\nit must replicate and keep a copy, for example:\n\nuse ms = new MemStream(...)\nms.Write(...)\nqueue.ToSend(cmd, ms)\n\nNow, since queue.ToSend actually enqueues the memstream and needs to save it,\nit internally will create a replica using ms.Replicate()\n\nMemoryStreamB replication is also now faster as both the buffers are RefCnt as\nwell as the list of buffers is RefCnt, so replication does not need to now create a new List.\nIt simply adds a refcnt to original list.\nAs this is all internal, the user of MemoryStreamB does not need to take care of anything.","distinct":true,"url":"https://api.github.com/repos/sanjeevm0/Prajna/commits/1b9869d80ff3a08978a0dc08e0894873a67a2570"}]}