You've already forked linux-packaging-mono
Imported Upstream version 4.8.0.309
Former-commit-id: 5f9c6ae75f295e057a7d2971f3a6df4656fa8850
This commit is contained in:
parent
ee1447783b
commit
94b2861243
38
mcs/class/corlib/Mono/SafeGPtrArrayHandle.cs
Normal file
38
mcs/class/corlib/Mono/SafeGPtrArrayHandle.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
//
|
||||
// Safe handle class for Mono.RuntimeGPtrArrayHandle
|
||||
//
|
||||
// Authors:
|
||||
// Aleksey Kliger <aleksey@xamarin.com>
|
||||
// Rodrigo Kumpera <kumpera@xamarin.com>
|
||||
//
|
||||
// Copyright 2016 Dot net foundation.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace Mono {
|
||||
internal struct SafeGPtrArrayHandle : IDisposable {
|
||||
RuntimeGPtrArrayHandle handle;
|
||||
|
||||
internal SafeGPtrArrayHandle (IntPtr ptr)
|
||||
{
|
||||
handle = new RuntimeGPtrArrayHandle (ptr);
|
||||
}
|
||||
|
||||
public void Dispose () {
|
||||
RuntimeGPtrArrayHandle.DestroyAndFree (ref handle);
|
||||
}
|
||||
|
||||
internal int Length {
|
||||
get {
|
||||
return handle.Length;
|
||||
}
|
||||
}
|
||||
|
||||
internal IntPtr this[int i] => handle[i];
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user