TimedOut = Tizen.Internals.Errors.ErrorCode.TimedOut,
OperationFailed = -0x030C0000 | 0x01,
}
-
- [DllImport(Libraries.Libc, EntryPoint = "malloc")]
- internal static extern IntPtr Malloc(int size);
}
}
internal static partial class Libraries
{
public const string Cion = "libcion.so.1";
- public const string Libc = "libc.so.6";
}
}
Marshal.Copy(data, receivedData, 0, dataSize);
byte[] returnDataRaw = OnDataReceived(receivedData, new PeerInfo(clone));
returnDataSize = returnDataRaw.Length;
- returnData = Interop.Cion.Malloc(returnDataSize);
+ returnData = Marshal.AllocHGlobal(returnDataSize);
Marshal.Copy(returnDataRaw, 0, returnData, returnDataSize);
});
ret = Interop.CionServer.CionServerSetDataReceivedCb(_handle, _dataReceivedCb, IntPtr.Zero);
+++ /dev/null
-/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-using System;
-using System.Runtime.InteropServices;
-
-internal static partial class Interop
-{
- internal static partial class Libc
- {
- [DllImport(Libraries.Libc, EntryPoint = "free", CallingConvention = CallingConvention.Cdecl)]
- internal static extern int Free(IntPtr ptr);
- }
-}
internal static partial class Libraries
{
public const string WidgetService = "libwidget_service.so.1";
- public const string Libc = "libc.so.6";
}
}
}
w = new int[cnt1];
Marshal.Copy(wPtr, w, 0, cnt1);
- Interop.Libc.Free(wPtr);
+ Marshal.FreeHGlobal(wPtr);
h = new int[cnt1];
Marshal.Copy(hPtr, h, 0, cnt1);
- Interop.Libc.Free(hPtr);
+ Marshal.FreeHGlobal(hPtr);
err = Interop.WidgetService.GetSupportedSizeTypes(Id, ref cnt2, out typesPtr);
switch (err)
types = new int[cnt2];
Marshal.Copy(typesPtr, types, 0, cnt2);
- Interop.Libc.Free(typesPtr);
+ Marshal.FreeHGlobal(typesPtr);
for (int i = 0; i < cnt1; i++)
{