メモリブロックの割当
Namespace: fvalgcliAssembly: fvalgcli (in fvalgcli.dll) Version: 3.1.0.0 (3.1.0.11)
Syntax
C# |
---|
public static IntPtr fnOAL_malloc(
SIZE_T tMemSize
) |
Visual Basic |
---|
Public Shared Function fnOAL_malloc (
tMemSize As SIZE_T
) As IntPtr |
Return Value
Type:
IntPtr
正常に終了した場合は、割り当てられたメモリブロックへのポインタを返します。
メモリ不足などで、異常終了した場合には、IntPtr.Zero を返します。
解放する際は
fnOAL_free(IntPtr) を使用してください。
Remarks
Examples
C# | Copy |
---|
using System;
using System.Collections.Generic;
using System.Text;
using fvalgcli;
namespace TC
{
public partial class FIE
{
[FvPluginExecute]
public void fnOAL_malloc()
{
PNT_T_PTR mem = PNT_T_PTR.Zero;
SIZE_T size = PNT_T_PTR.SizeOfItem * 1024;
try
{
mem = api.fnOAL_malloc(size);
Assert.IsTrue(mem != PNT_T_PTR.Zero, "fnOAL_malloc: エラーが発生しました。");
}
finally
{
api.fnOAL_free(mem);
}
}
}
} |
Visual Basic | Copy |
---|
Imports System.Collections.Generic
Imports System.Text
Imports fvalgcli
Public Partial Class FIE
<FvPluginExecute> _
Public Sub fnOAL_malloc()
Dim mem As PNT_T_PTR = PNT_T_PTR.Zero
Dim size As SIZE_T = PNT_T_PTR.SizeOfItem * 1024
Try
mem = api.fnOAL_malloc(size)
Assert.IsTrue(mem <> PNT_T_PTR.Zero, "fnOAL_malloc: エラーが発生しました。")
Finally
api.fnOAL_free(mem)
End Try
End Sub
End Class |
See Also