アライメントされたメモリブロックの解放

Namespace: fvalgcli
Assembly: fvalgcli (in fvalgcli.dll) Version: 3.1.0.0 (3.1.0.11)

Syntax

C#
public static void fnOAL_aligned_free(
	IntPtr pt
)
Visual Basic
Public Shared Sub fnOAL_aligned_free ( 
	pt As IntPtr
)

Parameters

pt
Type: System..::..IntPtr
確保済みメモリブロックへのポインタ

Remarks

fnOAL_aligned_malloc(SIZE_T, Int32) で確保された メモリブロックを解放します。

Examples

C# Copy imageCopy
//    $Revision: 1.1 $

using System;
using System.Collections.Generic;
using System.Text;
using fvalgcli;

namespace TC
{
    public partial class FIE
    {
        /// <summary>
        /// アライメントされたメモリブロックの割当.
        /// </summary>
        [FvPluginExecute]
        public void fnOAL_aligned_malloc()
        {
            SHORT_PTR mem = SHORT_PTR.Zero;
            SIZE_T size = SHORT_PTR.SizeOfItem * 1024;
            int align = 8;

            try
            {
                // 確保.
                mem = api.fnOAL_aligned_malloc(size, align);
                Assert.IsTrue(mem != SHORT_PTR.Zero, "fnOAL_aligned_malloc: エラーが発生しました。");
            }
            finally
            {
                // 開放.
                api.fnOAL_aligned_free(mem);
            }
        }
    }
}


Visual Basic Copy imageCopy
'    $Revision: 1.1 $

Imports System.Collections.Generic
Imports System.Text
Imports fvalgcli

Public Partial Class FIE
    ''' <summary>
    ''' アライメントされたメモリブロックの割当.
    ''' </summary>
    <FvPluginExecute> _
    Public Sub fnOAL_aligned_malloc()
        Dim mem As SHORT_PTR = SHORT_PTR.Zero
        Dim size As SIZE_T = SHORT_PTR.SizeOfItem * 1024
        Dim align As Integer = 8

        Try
            ' 確保.
            mem = api.fnOAL_aligned_malloc(size, align)
            Assert.IsTrue(mem <> SHORT_PTR.Zero, "fnOAL_aligned_malloc: エラーが発生しました。")
        Finally
            ' 開放.
            api.fnOAL_aligned_free(mem)
        End Try
    End Sub
End Class

See Also