Skip to content

Commit

Permalink
ADD STATIC MODIFIER FOR HELP COMPILER OPTIMIZATION
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
tseng0201 authored and tseng committed Jan 19, 2023
1 parent 61fb871 commit e9497bf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/riscv/i_system.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@
#include "console.h"

#ifdef COMBINE_SCREENS
unsigned char CombinedScreens[SCREENWIDTH*SCREENHEIGHT];
static unsigned char CombinedScreens[SCREENWIDTH*SCREENHEIGHT];
#else
unsigned char CombinedScreens[SCREENWIDTH*SCREENHEIGHT*4];
static unsigned char CombinedScreens[SCREENWIDTH*SCREENHEIGHT*4];
#endif

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

unsigned char DOOMHeap[DOOM_HEAP_SIZE];
static unsigned char DOOMHeap[DOOM_HEAP_SIZE];

enum {
KEY_EVENT = 0,
Expand Down

0 comments on commit e9497bf

Please sign in to comment.