diff options
Diffstat (limited to 'includes')
-rw-r--r-- | includes/Stg.h | 22 | ||||
-rw-r--r-- | includes/rts/storage/InfoTables.h | 2 | ||||
-rw-r--r-- | includes/stg/MiscClosures.h | 14 |
3 files changed, 24 insertions, 14 deletions
diff --git a/includes/Stg.h b/includes/Stg.h index ff5e3174c0..063959d880 100644 --- a/includes/Stg.h +++ b/includes/Stg.h @@ -222,13 +222,23 @@ typedef StgInt I_; typedef StgWord StgWordArray[]; typedef StgFunPtr F_; -#define EB_(X) extern char X[] -#define IB_(X) static char X[] -#define EI_(X) extern StgWordArray (X) GNU_ATTRIBUTE(aligned (8)) -#define II_(X) static StgWordArray (X) GNU_ATTRIBUTE(aligned (8)) +/* byte arrays (and strings): */ +#define EB_(X) extern const char X[] +#define IB_(X) static const char X[] +/* static (non-heap) closures (requires alignment for pointer tagging): */ +#define EC_(X) extern StgWordArray (X) GNU_ATTRIBUTE(aligned (8)) +#define IC_(X) static StgWordArray (X) GNU_ATTRIBUTE(aligned (8)) +/* writable data (does not require alignment): */ +#define ERW_(X) extern StgWordArray (X) +#define IRW_(X) static StgWordArray (X) +/* read-only data (does not require alignment): */ +#define ERO_(X) extern const StgWordArray (X) +#define IRO_(X) static const StgWordArray (X) +/* stg-native functions: */ #define IF_(f) static StgFunPtr GNUC3_ATTRIBUTE(used) f(void) -#define FN_(f) StgFunPtr f(void) -#define EF_(f) StgFunPtr f(void) /* External Cmm functions */ +#define FN_(f) StgFunPtr f(void) +#define EF_(f) StgFunPtr f(void) /* External Cmm functions */ +/* foreign functions: */ #define EFF_(f) void f() /* See Note [External function prototypes] */ /* Note [External function prototypes] See Trac #8965, #11395 diff --git a/includes/rts/storage/InfoTables.h b/includes/rts/storage/InfoTables.h index e732a30daf..3201c105e1 100644 --- a/includes/rts/storage/InfoTables.h +++ b/includes/rts/storage/InfoTables.h @@ -265,7 +265,7 @@ typedef struct { } StgFunInfoTable; // canned bitmap for each arg type, indexed by constants in FunTypes.h -extern StgWord stg_arg_bitmaps[]; +extern const StgWord stg_arg_bitmaps[]; /* ----------------------------------------------------------------------------- Return info tables diff --git a/includes/stg/MiscClosures.h b/includes/stg/MiscClosures.h index 1181abcca4..725323b395 100644 --- a/includes/stg/MiscClosures.h +++ b/includes/stg/MiscClosures.h @@ -20,10 +20,10 @@ #pragma once #if IN_STG_CODE -# define RTS_RET_INFO(i) extern W_(i)[] -# define RTS_FUN_INFO(i) extern W_(i)[] -# define RTS_THUNK_INFO(i) extern W_(i)[] -# define RTS_INFO(i) extern W_(i)[] +# define RTS_RET_INFO(i) extern const W_(i)[] +# define RTS_FUN_INFO(i) extern const W_(i)[] +# define RTS_THUNK_INFO(i) extern const W_(i)[] +# define RTS_INFO(i) extern const W_(i)[] # define RTS_CLOSURE(i) extern W_(i)[] # define RTS_FUN_DECL(f) extern DLL_IMPORT_RTS StgFunPtr f(void) #else @@ -488,9 +488,9 @@ extern StgWord RTS_VAR(sched_mutex); // Apply.cmm // canned bitmap for each arg type -extern StgWord stg_arg_bitmaps[]; -extern StgWord stg_ap_stack_entries[]; -extern StgWord stg_stack_save_entries[]; +extern const StgWord stg_arg_bitmaps[]; +extern const StgWord stg_ap_stack_entries[]; +extern const StgWord stg_stack_save_entries[]; // Storage.c extern unsigned int RTS_VAR(g0); |