@@ -35,7 +35,7 @@ public static IEnumerable<object[]> TrueFalse()
3535 public void ContentLength_LengthMatchesArrayLength ( int contentLength , bool useArray )
3636 {
3737 Memory < byte > memory ;
38- using ( ReadOnlyMemoryContent content = CreateContent ( contentLength , useArray , out memory , out MemoryManager < byte > ownedMemory ) )
38+ using ( ReadOnlyMemoryContent content = CreateContent ( contentLength , useArray , out memory , out IMemoryOwner < byte > memoryOwner ) )
3939 {
4040 Assert . Equal ( contentLength , content . Headers . ContentLength ) ;
4141 }
@@ -48,7 +48,7 @@ public async Task ReadAsStreamAsync_TrivialMembersHaveExpectedValuesAndBehavior(
4848 const int ContentLength = 42 ;
4949 Memory < byte > memory ;
5050
51- using ( ReadOnlyMemoryContent content = CreateContent ( ContentLength , useArray , out memory , out MemoryManager < byte > ownedMemory ) )
51+ using ( ReadOnlyMemoryContent content = CreateContent ( ContentLength , useArray , out memory , out IMemoryOwner < byte > memoryOwner ) )
5252 {
5353 using ( Stream stream = await content . ReadAsStreamAsync ( ) )
5454 {
@@ -82,7 +82,7 @@ public async Task ReadAsStreamAsync_Seek(bool useArray)
8282 const int ContentLength = 42 ;
8383 Memory < byte > memory ;
8484
85- using ( ReadOnlyMemoryContent content = CreateContent ( ContentLength , useArray , out memory , out MemoryManager < byte > ownedMemory ) )
85+ using ( ReadOnlyMemoryContent content = CreateContent ( ContentLength , useArray , out memory , out IMemoryOwner < byte > memoryOwner ) )
8686 {
8787 using ( Stream s = await content . ReadAsStreamAsync ( ) )
8888 {
@@ -144,7 +144,7 @@ public async Task ReadAsStreamAsync_ReadByte_MatchesInput(int contentLength, boo
144144 {
145145 Memory < byte > memory ;
146146
147- using ( ReadOnlyMemoryContent content = CreateContent ( contentLength , useArray , out memory , out MemoryManager < byte > ownedMemory ) )
147+ using ( ReadOnlyMemoryContent content = CreateContent ( contentLength , useArray , out memory , out IMemoryOwner < byte > memoryOwner ) )
148148 {
149149 using ( Stream stream = await content . ReadAsStreamAsync ( ) )
150150 {
@@ -166,7 +166,7 @@ public async Task ReadAsStreamAsync_Read_InvalidArguments(bool useArray)
166166 const int ContentLength = 42 ;
167167 Memory < byte > memory ;
168168
169- using ( ReadOnlyMemoryContent content = CreateContent ( ContentLength , useArray , out memory , out MemoryManager < byte > ownedMemory ) )
169+ using ( ReadOnlyMemoryContent content = CreateContent ( ContentLength , useArray , out memory , out IMemoryOwner < byte > memoryOwner ) )
170170 {
171171 using ( Stream stream = await content . ReadAsStreamAsync ( ) )
172172 {
@@ -203,7 +203,7 @@ public async Task ReadAsStreamAsync_ReadMultipleBytes_MatchesInput(int mode, boo
203203 const int ContentLength = 1024 ;
204204
205205 Memory < byte > memory ;
206- using ( ReadOnlyMemoryContent content = CreateContent ( ContentLength , useArray , out memory , out MemoryManager < byte > ownedMemory ) )
206+ using ( ReadOnlyMemoryContent content = CreateContent ( ContentLength , useArray , out memory , out IMemoryOwner < byte > memoryOwner ) )
207207 {
208208 var buffer = new byte [ 3 ] ;
209209
@@ -244,7 +244,7 @@ public async Task ReadAsStreamAsync_ReadWithCancelableToken_MatchesInput(bool us
244244 const int ContentLength = 100 ;
245245
246246 Memory < byte > memory ;
247- using ( ReadOnlyMemoryContent content = CreateContent ( ContentLength , useArray , out memory , out MemoryManager < byte > ownedMemory ) )
247+ using ( ReadOnlyMemoryContent content = CreateContent ( ContentLength , useArray , out memory , out IMemoryOwner < byte > memoryOwner ) )
248248 {
249249 var buffer = new byte [ 1 ] ;
250250 var cts = new CancellationTokenSource ( ) ;
@@ -278,7 +278,7 @@ public async Task ReadAsStreamAsync_ReadWithCanceledToken_MatchesInput(bool useA
278278
279279 Memory < byte > memory ;
280280
281- using ( ReadOnlyMemoryContent content = CreateContent ( ContentLength , useArray , out memory , out MemoryManager < byte > ownedMemory ) )
281+ using ( ReadOnlyMemoryContent content = CreateContent ( ContentLength , useArray , out memory , out IMemoryOwner < byte > memoryOwner ) )
282282 {
283283 using ( Stream stream = await content . ReadAsStreamAsync ( ) )
284284 {
@@ -294,7 +294,7 @@ public async Task ReadAsStreamAsync_ReadWithCanceledToken_MatchesInput(bool useA
294294 public async Task CopyToAsync_AllContentCopied ( int contentLength , bool useArray )
295295 {
296296 Memory < byte > memory ;
297- using ( ReadOnlyMemoryContent content = CreateContent ( contentLength , useArray , out memory , out MemoryManager < byte > ownedMemory ) )
297+ using ( ReadOnlyMemoryContent content = CreateContent ( contentLength , useArray , out memory , out IMemoryOwner < byte > memoryOwner ) )
298298 {
299299
300300 var destination = new MemoryStream ( ) ;
@@ -309,7 +309,7 @@ public async Task CopyToAsync_AllContentCopied(int contentLength, bool useArray)
309309 public async Task ReadAsStreamAsync_CopyTo_AllContentCopied ( int contentLength , bool useArray )
310310 {
311311 Memory < byte > memory ;
312- using ( ReadOnlyMemoryContent content = CreateContent ( contentLength , useArray , out memory , out MemoryManager < byte > ownedMemory ) )
312+ using ( ReadOnlyMemoryContent content = CreateContent ( contentLength , useArray , out memory , out IMemoryOwner < byte > memoryOwner ) )
313313 {
314314
315315 var destination = new MemoryStream ( ) ;
@@ -328,7 +328,7 @@ public async Task ReadAsStreamAsync_CopyTo_InvalidArguments(bool useArray)
328328 {
329329 const int ContentLength = 42 ;
330330 Memory < byte > memory ;
331- using ( ReadOnlyMemoryContent content = CreateContent ( ContentLength , useArray , out memory , out MemoryManager < byte > ownedMemory ) )
331+ using ( ReadOnlyMemoryContent content = CreateContent ( ContentLength , useArray , out memory , out IMemoryOwner < byte > memoryOwner ) )
332332 {
333333 using ( Stream s = await content . ReadAsStreamAsync ( ) )
334334 {
@@ -354,7 +354,7 @@ public async Task ReadAsStreamAsync_CopyTo_InvalidArguments(bool useArray)
354354 public async Task ReadAsStreamAsync_CopyToAsync_AllContentCopied ( int contentLength , bool useArray )
355355 {
356356 Memory < byte > memory ;
357- using ( ReadOnlyMemoryContent content = CreateContent ( contentLength , useArray , out memory , out MemoryManager < byte > ownedMemory ) )
357+ using ( ReadOnlyMemoryContent content = CreateContent ( contentLength , useArray , out memory , out IMemoryOwner < byte > memoryOwner ) )
358358 {
359359
360360 var destination = new MemoryStream ( ) ;
@@ -367,17 +367,17 @@ public async Task ReadAsStreamAsync_CopyToAsync_AllContentCopied(int contentLeng
367367 }
368368 }
369369
370- private static ReadOnlyMemoryContent CreateContent ( int contentLength , bool useArray , out Memory < byte > memory , out MemoryManager < byte > ownedMemory )
370+ private static ReadOnlyMemoryContent CreateContent ( int contentLength , bool useArray , out Memory < byte > memory , out IMemoryOwner < byte > memoryOwner )
371371 {
372372 if ( useArray )
373373 {
374374 memory = new byte [ contentLength ] ;
375- ownedMemory = null ;
375+ memoryOwner = null ;
376376 }
377377 else
378378 {
379- ownedMemory = new NativeMemoryManager ( contentLength ) ;
380- memory = ownedMemory . Memory ;
379+ memoryOwner = new NativeMemoryManager ( contentLength ) ;
380+ memory = memoryOwner . Memory ;
381381 }
382382
383383 new Random ( contentLength ) . NextBytes ( memory . Span ) ;
0 commit comments