From 9302d4708c97fbbde8751a5c3e14795c693fc675 Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Fri, 28 Sep 2018 22:52:19 -0400 Subject: [PATCH] adds meson option (-Dgc=true) to set U3_MEMORY_DEBUG --- include/config.h.in | 2 ++ include/noun/allocate.h | 6 ------ meson.build | 1 + meson_options.txt | 2 ++ 4 files changed, 5 insertions(+), 6 deletions(-) create mode 100644 meson_options.txt diff --git a/include/config.h.in b/include/config.h.in index 66f7783096..d2d7baff8a 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -10,4 +10,6 @@ #mesondefine U3_OS_ENDIAN_little #mesondefine U3_OS_ENDIAN_big +#mesondefine U3_MEMORY_DEBUG + #endif /*CONFIG_H*/ diff --git a/include/noun/allocate.h b/include/noun/allocate.h index 075b12d2fe..efce7ed970 100644 --- a/include/noun/allocate.h +++ b/include/noun/allocate.h @@ -2,12 +2,6 @@ ** ** This file is in the public domain. */ - /** Options. - **/ - /* U3_MEMORY_DEBUG: add debugging information to heap. Breaks image. - */ -# undef U3_MEMORY_DEBUG - /** Constants. **/ /* u3a_bits: number of bits in word-addressed pointer. 29 == 2GB. diff --git a/meson.build b/meson.build index 2fc9b14533..d8c17808cb 100644 --- a/meson.build +++ b/meson.build @@ -264,6 +264,7 @@ incdir = include_directories('include/') conf_data = configuration_data() conf_data.set('URBIT_VERSION', '"0.6.0"') +conf_data.set('U3_MEMORY_DEBUG', get_option('gc')) osdet = build_machine.system() os_c_flags = ['-funsigned-char','-ffast-math'] diff --git a/meson_options.txt b/meson_options.txt new file mode 100644 index 0000000000..4f9bb057a1 --- /dev/null +++ b/meson_options.txt @@ -0,0 +1,2 @@ +option('gc', type : 'boolean', value : false, + description : 'Add debugging information to heap. Run with -g. Breaks image.')