Skip to content

Commit b804675

Browse files
author
ale
committed
代码
1 parent c16e1fb commit b804675

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+1635
-1631
lines changed

LuaProfiler/Tools/InjectLua/InjectLua/Parse/LLex.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,7 @@ public int Length
512512

513513
public void Replace(int start, int end, string value)
514514
{
515-
LoadInfo.Replace(start, end + 1 - start, value);
515+
LoadInfo.Replace(start, end - start, value);
516516
}
517517

518518
public string ReadString(int start, int end)

LuaProfiler/Tools/InjectLua/InjectLua/Parse/Parse.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,9 +223,8 @@ static void InsertSample(LLex l, ref int lastPos, ref int nextPos, int tokenType
223223
{
224224
lastPos = lastPos - 1;
225225

226-
string returnStr = l.ReadString(insertPos, lastPos - 1);
227-
returnStr = " return miku_unpack_return_value(" + returnStr.Substring(6, returnStr.Length - 6) + ") ";
228-
l.Replace(insertPos, lastPos - 1, returnStr);
226+
l.Replace(insertPos, insertPos + 6, " return miku_unpack_return_value(");
227+
l.InsertString(lastPos , ") ");
229228

230229
nextPos = l.pos;
231230
if (tokenType == (int)TK.END)

LuaProfiler/example/Assets/Plugins/Android/java/ShadowHook.java renamed to LuaProfiler/Tools/shadowhook/ShadowHook.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,10 @@ public final class ShadowHook {
3838

3939
private static final ILibLoader defaultLibLoader = null;
4040
private static final int defaultMode = Mode.UNIQUE.getValue();
41-
private static final boolean defaultDebuggable = true;
41+
private static final boolean defaultDebuggable = false;
4242

4343
public static int init() {
44-
if (inited) {
45-
return initErrno;
46-
}
47-
48-
return init(new ConfigBuilder().build());
44+
return init(null);
4945
}
5046

5147
public static synchronized int init(Config config) {
@@ -56,6 +52,11 @@ public static synchronized int init(Config config) {
5652

5753
long start = System.currentTimeMillis();
5854

55+
if (config == null) {
56+
//use default parameters
57+
config = new ConfigBuilder().build();
58+
}
59+
5960
if (!loadLibrary(config)) {
6061
initErrno = ERRNO_LOAD_LIBRARY_EXCEPTION;
6162
initCostMs = System.currentTimeMillis() - start;

LuaProfiler/example/Assets/LuaProfiler/Common/Setting/LuaDeepProfilerSetting.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public static LuaDeepProfilerSetting Instance
5353
{
5454
if (instance == null)
5555
{
56-
instance = new LuaDeepProfilerSetting();
56+
instance = Load();
5757
}
5858
return instance;
5959
}
@@ -315,7 +315,7 @@ public static LuaDeepProfilerSetting Load()
315315

316316
try
317317
{
318-
JsonUtility.FromJson<LuaDeepProfilerSetting>(json);
318+
result = JsonUtility.FromJson<LuaDeepProfilerSetting>(json);
319319
}
320320
catch
321321
{

0 commit comments

Comments
 (0)