Skip to content

Commit

Permalink
[change] RuntimeApi::GetInterpreterThreadFrameStackSize 之类的函数在Editor下…
Browse files Browse the repository at this point in the history
…为空非extern函数,避免Editor下调用时出错
  • Loading branch information
walon committed Jul 3, 2023
1 parent 058270c commit 1d09f72
Showing 1 changed file with 37 additions and 3 deletions.
40 changes: 37 additions & 3 deletions Runtime/RuntimeApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,36 +42,70 @@ public static unsafe LoadImageErrorCode LoadMetadataForAOTAssembly(byte[] dllByt
/// <param name="dllBytes"></param>
/// <param name="dllSize"></param>
/// <returns></returns>
#if UNITY_EDITOR
public static unsafe int LoadMetadataForAOTAssembly(byte* dllBytes, int dllSize, int mode)
{
return 0;
}
#else
[DllImport(dllName, EntryPoint = "RuntimeApi_LoadMetadataForAOTAssembly")]
public static extern unsafe int LoadMetadataForAOTAssembly(byte* dllBytes, int dllSize, int mode);
#endif


/// <summary>
/// 获取解释器线程栈的最大StackObject个数(size*8 为最终占用的内存大小)
/// </summary>
/// <returns></returns>
#if UNITY_EDITOR
public static int GetInterpreterThreadObjectStackSize()
{
return 0;
}
#else
[DllImport(dllName, EntryPoint = "RuntimeApi_GetInterpreterThreadObjectStackSize")]
public static extern int GetInterpreterThreadObjectStackSize();

#endif

/// <summary>
/// 设置解释器线程栈的最大StackObject个数(size*8 为最终占用的内存大小)
/// </summary>
/// <param name="size"></param>
#if UNITY_EDITOR
public static void SetInterpreterThreadObjectStackSize(int size)
{

}
#else
[DllImport(dllName, EntryPoint = "RuntimeApi_SetInterpreterThreadObjectStackSize")]
public static extern void SetInterpreterThreadObjectStackSize(int size);

#endif
/// <summary>
/// 获取解释器线程函数帧数量(sizeof(InterpreterFrame)*size 为最终占用的内存大小)
/// </summary>
/// <returns></returns>
#if UNITY_EDITOR
public static int GetInterpreterThreadFrameStackSize()
{
return 0;
}
#else
[DllImport(dllName, EntryPoint = "RuntimeApi_GetInterpreterThreadFrameStackSize")]
public static extern int GetInterpreterThreadFrameStackSize();

#endif

/// <summary>
/// 设置解释器线程函数帧数量(sizeof(InterpreterFrame)*size 为最终占用的内存大小)
/// </summary>
/// <param name="size"></param>
#if UNITY_EDITOR
public static void SetInterpreterThreadFrameStackSize(int size)
{

}
#else
[DllImport(dllName, EntryPoint = "RuntimeApi_SetInterpreterThreadFrameStackSize")]
public static extern void SetInterpreterThreadFrameStackSize(int size);
#endif
}
}

0 comments on commit 1d09f72

Please sign in to comment.