Skip to content

Commit 39c9238

Browse files
tseng0201tseng
authored and
tseng
committedJan 20, 2023
ADD STATIC MODIFIER FOR HELP COMPILER OPTIMIZATION
Add static modifier on CombinedScreens and DOOMHeap in i_system.c for help compiler optimization. No other file use both array directly and they use them by pointer.
1 parent 3f47238 commit 39c9238

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed
 

‎src/riscv/i_system.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@
4040
#include "console.h"
4141

4242
#ifdef COMBINE_SCREENS
43-
unsigned char CombinedScreens[SCREENWIDTH*SCREENHEIGHT];
43+
static unsigned char CombinedScreens[SCREENWIDTH*SCREENHEIGHT];
4444
#else
45-
unsigned char CombinedScreens[SCREENWIDTH*SCREENHEIGHT*4];
45+
static unsigned char CombinedScreens[SCREENWIDTH*SCREENHEIGHT*4];
4646
#endif
4747

4848
/* Original 6M - wipe function (130560 bytes) */
@@ -52,7 +52,7 @@ unsigned char CombinedScreens[SCREENWIDTH*SCREENHEIGHT*4];
5252
#define DOOM_HEAP_SIZE 6*1024*1024
5353
#endif
5454

55-
unsigned char DOOMHeap[DOOM_HEAP_SIZE];
55+
static unsigned char DOOMHeap[DOOM_HEAP_SIZE];
5656

5757
enum {
5858
KEY_EVENT = 0,

0 commit comments

Comments
 (0)