Ignore:
Timestamp:
Nov 25, 2007, 4:31:35 PM (16 years ago)
Author:
イグトランス (egtra)
Message:

Stringなどで例外を投げるようにした。
#147の解決。
CType ASCII文字判定関数群の追加。

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Include/Classes/System/Environment.ab

    r337 r388  
    3131    Static Function CurrentDirectory() As String
    3232        Dim size = GetCurrentDirectory(0, 0)
    33         Dim p = _System_malloc(SizeOf (TCHAR) * size) As PCTSTR
     33        Dim p = GC_malloc_atomic(SizeOf (TCHAR) * size) As PCTSTR
    3434        Dim len = GetCurrentDirectory(size, p)
    3535        If len < size Then
    3636            CurrentDirectory = New String(p, size As Long)
    37             _System_free(p)
    3837        End If
    3938    End Function
     
    9291        If Object.ReferenceEquals(sysDir, Nothing) Then
    9392            Dim size = GetSystemDirectory(0, 0)
    94             Dim p = _System_malloc(SizeOf (TCHAR) * size) As PTSTR
     93            Dim p = GC_malloc_atomic(SizeOf (TCHAR) * size) As PTSTR
    9594            Dim len = GetSystemDirectory(p, size)
    9695            sysDir = New String(p, len As Long)
    97             _System_free(p)
    9896        End If
    9997        Return sysDir
     
    145143        Dim src = ToTCStr(s)
    146144        Dim size = ExpandEnvironmentStrings(src, 0, 0)
    147         Dim dst = _System_malloc(SizeOf (TCHAR) * size) As PTSTR
     145        Dim dst = GC_malloc_atomic(SizeOf (TCHAR) * size) As PTSTR
    148146        ExpandEnvironmentStrings(src, dst, size)
    149147        ExpandEnvironmentVariables = New String(dst, size - 1)
    150         _System_free(dst)
    151148    End Function
    152149
     
    160157        Dim tcsVariable = ToTCStr(variable)
    161158        Dim size = _System_GetEnvironmentVariable(tcsVariable, 0, 0)
    162         Dim p = _System_malloc(SizeOf (TCHAR) * size) As PTSTR
     159        Dim p = GC_malloc_atomic(SizeOf (TCHAR) * size) As PTSTR
    163160        Dim len = _System_GetEnvironmentVariable(tcsVariable, p, size)
    164161        GetEnvironmentVariable = New String(p, len As Long)
    165         _System_free(p)
    166162    End Function
    167163
Note: See TracChangeset for help on using the changeset viewer.