Hi Guest

MobileUser

1 HomePage 1 Jobs 1 WalkIn 1Articles  

Cat Exam

 :) Latest Topic
AJAX
VB.NET
SQL Query
UDDI
CLASS
JavaScript Questions
SharePoint Interview
SilverLight
WCF
general knowledge
 ASP.NET
 :) Hot Jobs
 
 :) Latest Articles


  

 


Write down some common difference between Span<T> and Array?
Question Posted on 22 Feb 2022

Home >> DotNet >> C# >> Write down some common difference between Span<T> and Array?




Write down some common difference between Span T and Array? Some of the user saying Span is valid replacement for Array below are the some of the common difference between 2 of this.
0
0

Base of DifferenceSpan<T>Array
StackThis is possible in Span<T>.ArraySegment<T> is limited to managed array and we cannot use it to wrap data allocated on the stack by using stackalloc.
Value AddedSpan<T> will not replace anything it is only a value added and this will provides a type safe view into continuous segments of memoryN.A
Represent DataSpan<T> and array comes from the fact that Span<T> is a view on some data and most of the time this data is represented through an array.Array is still needed and Span<T> is a just a convenient view on it.
Read OnlySpan<T> provide a read only view.ArraySegment<T> will not provide a read only view.
MemorySpan<T> can handle both managed and unmanaged memory.ArraySegment<T> is only limited to managed memory.
Relation with GCThis has a special relation with GC which makes it more performant that ArraySegment<T> in stack only scenarios.Not doing this


 
 Input Your Comments Or suggestions(If Any)
 Name
 Email(optional)
 Comments


Other Important Questions
Simplest definition of partial classes and its rules?
Definition of Tuple class with some examples?
Define Race Condition in cSharp?
C#.Net Reserve Words
can we inherit private class level variables in c#






 
Top Searches:asp net questions vb net questions sql query uddl questions class javascript Questions sharepoint interview questions and concept silverlight questions and concept wcf questions beans general knowledge ajax questions
PHP | Biztalk | Testing | SAP | HR |