Skip to content

Commit 2a23f75

Browse files
committed
Use faster code scanning.
1 parent cfcef45 commit 2a23f75

File tree

6 files changed

+9
-12
lines changed

6 files changed

+9
-12
lines changed

YSI_Coding/y_functional/y_functional_rewrite.inc

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -188,11 +188,6 @@ static stock Functional_FoundCall(const scanner[CodeScanner], nestingLevel)
188188
{
189189
return -1;
190190
}
191-
192-
if (heapspace() < 2000)
193-
{
194-
P:F("Insufficient stack space found. Increase it (significantly over the default of 4096) with `#pragma dynamic` or `-S`.");
195-
}
196191

197192
new
198193
callPos = CodeScanGetMatchAddressData(scanner);
@@ -416,7 +411,8 @@ public OnCodeInit()
416411
);
417412
CodeScanAddMatcher(scanner, lambdaCall2);
418413

419-
CodeScanRun(scanner);
414+
// Run fast, with an explicit search function.
415+
CodeScanRunFast(scanner, &LAM@0);
420416

421417
#if defined Functional_OnCodeInit
422418
Functional_OnCodeInit();

YSI_Coding/y_hooks/y_hooks_macros.inc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ Optional plugins:
9090
#define @yH_stock%0\32;%1(%2);%3(%4) HOOK_REDO__ %0%1(%2)
9191
#define @yH_function%0\32;%1(%2);%3(%4) HOOK_REDO__ %0%1(%2)
9292

93-
#define HOOK_PUBLIC__%1(%2) forward UNIQUE_FUNCTION<@H_y%1@...>(%2);UNIQUE_FUNCTION<@H_y%1@...>(%2)
94-
#define HOOK_public__%1(%2) forward UNIQUE_FUNCTION<@H_y%1@...>(%2);UNIQUE_FUNCTION<@H_y%1@...>(%2)
93+
//#define HOOK_PUBLIC__%1(%2) forward UNIQUE_FUNCTION<@H_y%1@...>(%2);UNIQUE_FUNCTION<@H_y%1@...>(%2)
94+
//#define HOOK_public__%1(%2) forward UNIQUE_FUNCTION<@H_y%1@...>(%2);UNIQUE_FUNCTION<@H_y%1@...>(%2)
9595

9696
#define HOOK__%1(%2) forward UNIQUE_FUNCTION<@yH_%1@...>(%2);UNIQUE_FUNCTION<@yH_%1@...>(%2)
9797
#define REHOOK__ HOOK__

YSI_Coding/y_hooks/y_hooks_tests.inc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -901,7 +901,8 @@ REHOOK__ y_hooks_State1(string:c[]) <y_hooks_state : y_hooks_state_3>
901901
g_y_hooksVar += strval(c[5]);
902902
}
903903

904-
HOOK__ public y_hooks_State1(string:c[]) <y_hooks_state : y_hooks_state_4>
904+
//HOOK__ public y_hooks_State1(string:c[]) <y_hooks_state : y_hooks_state_4>
905+
hook y_hooks_State1(string:c[]) <y_hooks_state : y_hooks_state_4>
905906
{
906907
g_y_hooksVar = strval(c[5]);
907908
}

YSI_Coding/y_inline/y_inline_impl2.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -855,7 +855,7 @@ public OnCodeInit()
855855
// TODO: Try and determine rough types for parent function parameters, using
856856
// Opcodes like LREF, SREF, and IDXADDR (IDXARRAY? Can't remember off the
857857
// top of my head).
858-
CodeScanRun(scanner);
858+
CodeScanRunFast(scanner, &I@T);
859859

860860
#if defined Inline_OnCodeInit
861861
Inline_OnCodeInit();

YSI_Coding/y_va/y_va_impl.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,7 @@ static stock YVA2_Initalise()
616616
);
617617
CodeScanAddMatcher(scanner, csm3);
618618
// Replace calls with the correct parameter counts etc.
619-
CodeScanRun(scanner);
619+
CodeScanRunFast(scanner, &YVA2_DummyPush);
620620
//DisasmDump("yva2.asm");
621621
return 1;
622622
}

YSI_Core/y_core/y_thirdpartyinclude.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ Optional plugins:
318318

319319
#if defined AMX_INCLUDING_FAILED
320320
#error Could not include "https://github.com/Zeex/amx_assembly" - ensure its files are in "include\amx_assembly\"
321-
#elseif !defined __REF
321+
#elseif !defined CodeScanRunFast
322322
#error Please update "https://github.com/Zeex/amx_assembly" to the latest version.
323323
#endif
324324

0 commit comments

Comments
 (0)