Skip to content

Commit

Permalink
Engine: increase the cap of active script instances to 1024
Browse files Browse the repository at this point in the history
This has an effect only on resolved bytecode created at runtime, which is never serialized. Thus there's no backwards compatibility issue.
  • Loading branch information
ivan-mogilko committed Dec 16, 2024
1 parent a6a1279 commit 7b5c537
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions Engine/script/cc_instance.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,13 @@ using namespace AGS;
#define MAX_CALL_STACK 128
#define MAX_FUNCTION_PARAMS 20

// 256 because we use 8 bits to hold instance number
#define MAX_PRIMARY_INSTANCES 256

#define INSTANCE_ID_SHIFT 24LL
#define INSTANCE_ID_MASK 0x00000000000000ffLL
#define INSTANCE_ID_REMOVEMASK 0x0000000000ffffffLL
// We use 10 bits to hold instance IDs ORed with op-code
#define INSTANCE_ID_SHIFT 22LL
#define INSTANCE_ID_MASK 0x00000000000003FFLL
#define INSTANCE_ID_REMOVEMASK 0x00000000003FFFFFLL
// This gives us 1024 unique instance IDs
// NOTE: these are given to the primary instances only, not forks
#define MAX_PRIMARY_INSTANCES 1024

// Script executor debugging flag:
// enables mistake checks, but slows things down!
Expand Down

0 comments on commit 7b5c537

Please sign in to comment.