C# 클래스 IronPython.Modules.MemoryHolder

A wrapper around allocated memory to ensure it gets released and isn't accessed when it could be finalized.
상속: System.Runtime.ConstrainedExecution.CriticalFinalizerObject
파일 보기 프로젝트 열기: jschementi/iron 1 사용 예제들

공개 메소드들

메소드 설명
CopyFrom ( IntPtr source, IntPtr size ) : void

Copies the data in data into this MemoryHolder.

CopyTo ( MemoryHolder destAddress, int writeOffset, int size ) : void

Copies memory from one location to another keeping the associated memory holders alive during the operation.

GetSubBlock ( int offset ) : MemoryHolder
MemoryHolder ( IntPtr data, int size ) : System

Creates a new MemoryHolder at the specified address which is not tracked by us and we will never free.

MemoryHolder ( IntPtr data, int size, MemoryHolder parent ) : System

Creates a new MemoryHolder at the specified address which will keep alive the parent memory holder.

ReadByte ( int offset ) : byte
ReadInt16 ( int offset ) : short
ReadInt32 ( int offset ) : int
ReadInt64 ( int offset ) : long
ReadIntPtr ( int offset ) : IntPtr
ReadMemoryHolder ( int offset ) : MemoryHolder
WriteByte ( int offset, byte value ) : void
WriteInt16 ( int offset, short value ) : void
WriteInt32 ( int offset, int value ) : void
WriteInt64 ( int offset, long value ) : void
WriteIntPtr ( int offset, IntPtr value ) : void
WriteIntPtr ( int offset, MemoryHolder address ) : void

비공개 메소드들

메소드 설명
AddObject ( object key, object value ) : void

Used to track the lifetime of objects when one memory region depends upon another memory region. For example if you have an array of objects that each have an element which has it's own lifetime the array needs to keep the individual elements alive. The keys used here match CPython's keys as tested by CPython's test_ctypes. Typically they are a string which is the array index, "ffffffff" when from_buffer is used, or when it's a simple type there's just a string instead of the full dictionary - we store that under the key "str".

EnsureObjects ( ) : PythonDictionary
MemoryHolder ( int size ) : System
ReadAnsiString ( IntPtr addr, int offset ) : string
ReadAnsiString ( IntPtr addr, int offset, int length ) : string
ReadAnsiString ( int offset ) : string
ReadAnsiString ( int offset, int length ) : string
ReadUnicodeString ( int offset ) : string
ReadUnicodeString ( int offset, int length ) : string
WriteAnsiString ( int offset, string value ) : void
WriteUnicodeString ( int offset, string value ) : void

메소드 상세

CopyFrom() 공개 메소드

Copies the data in data into this MemoryHolder.
public CopyFrom ( IntPtr source, IntPtr size ) : void
source System.IntPtr
size System.IntPtr
리턴 void

CopyTo() 공개 메소드

Copies memory from one location to another keeping the associated memory holders alive during the operation.
public CopyTo ( MemoryHolder destAddress, int writeOffset, int size ) : void
destAddress MemoryHolder
writeOffset int
size int
리턴 void

GetSubBlock() 공개 메소드

public GetSubBlock ( int offset ) : MemoryHolder
offset int
리턴 MemoryHolder

MemoryHolder() 공개 메소드

Creates a new MemoryHolder at the specified address which is not tracked by us and we will never free.
public MemoryHolder ( IntPtr data, int size ) : System
data System.IntPtr
size int
리턴 System

MemoryHolder() 공개 메소드

Creates a new MemoryHolder at the specified address which will keep alive the parent memory holder.
public MemoryHolder ( IntPtr data, int size, MemoryHolder parent ) : System
data System.IntPtr
size int
parent MemoryHolder
리턴 System

ReadByte() 공개 메소드

public ReadByte ( int offset ) : byte
offset int
리턴 byte

ReadInt16() 공개 메소드

public ReadInt16 ( int offset ) : short
offset int
리턴 short

ReadInt32() 공개 메소드

public ReadInt32 ( int offset ) : int
offset int
리턴 int

ReadInt64() 공개 메소드

public ReadInt64 ( int offset ) : long
offset int
리턴 long

ReadIntPtr() 공개 메소드

public ReadIntPtr ( int offset ) : IntPtr
offset int
리턴 System.IntPtr

ReadMemoryHolder() 공개 메소드

public ReadMemoryHolder ( int offset ) : MemoryHolder
offset int
리턴 MemoryHolder

WriteByte() 공개 메소드

public WriteByte ( int offset, byte value ) : void
offset int
value byte
리턴 void

WriteInt16() 공개 메소드

public WriteInt16 ( int offset, short value ) : void
offset int
value short
리턴 void

WriteInt32() 공개 메소드

public WriteInt32 ( int offset, int value ) : void
offset int
value int
리턴 void

WriteInt64() 공개 메소드

public WriteInt64 ( int offset, long value ) : void
offset int
value long
리턴 void

WriteIntPtr() 공개 메소드

public WriteIntPtr ( int offset, IntPtr value ) : void
offset int
value System.IntPtr
리턴 void

WriteIntPtr() 공개 메소드

public WriteIntPtr ( int offset, MemoryHolder address ) : void
offset int
address MemoryHolder
리턴 void