diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2016-08-28 18:12:03 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2016-08-28 18:37:57 -0700 |
commit | 5f05e954ee1f1daf953b3ff20af81775f226d5bf (patch) | |
tree | 21a691619f0e260e18df4140d4d8381682ecd979 /034address.cc | |
parent | c7fde8d4e4175b436bc8db92bedd231261827e2c (diff) | |
download | mu-5f05e954ee1f1daf953b3ff20af81775f226d5bf.tar.gz |
3273
Undo 3272. The trouble with creating a new section for constants is that there's no good place to order it since constants can be initialized using globals as well as vice versa. And I don't want to add constraints disallowing either side. Instead, a new plan: always declare constants in the Globals section using 'extern const' rather than just 'const', since otherwise constants implicitly have internal linkage (http://stackoverflow.com/questions/14894698/why-does-extern-const-int-n-not-work-as-expected)
Diffstat (limited to '034address.cc')
-rw-r--r-- | 034address.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/034address.cc b/034address.cc index cd48680b..aa47cc1c 100644 --- a/034address.cc +++ b/034address.cc @@ -245,7 +245,7 @@ void transform_new_to_allocate(const recipe_ordinal r) { //: implement 'allocate' based on size :(before "End Globals") -const int Reserved_for_tests = 1000; +extern const int Reserved_for_tests = 1000; int Memory_allocated_until = Reserved_for_tests; int Initial_memory_per_routine = 100000; :(before "End Setup") |