From 49f0560827c2183e75a7817034e663736f74c83c Mon Sep 17 00:00:00 2001 From: Elliot Ronaghan Date: Sat, 11 Mar 2017 22:28:00 -0800 Subject: [PATCH 1/4] Revert "add allocator directory to extra-dist" This reverts commit 04dee4e7c2363d38c20a6d24c980f6a76500358b. Revert adding all of 'alloc/' to EXTRA_DIST in favor of adding the individual allocators. --- src/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Makefile.am b/src/Makefile.am index 7c2625fbb..43868a272 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -35,7 +35,7 @@ libqthread_la_SOURCES = \ touch.c \ teams.c -EXTRA_DIST = alloc/ +EXTRA_DIST = if COMPILE_LF_HASH libqthread_la_SOURCES += lf_hashmap.c From c29c055eaec2a654171d34717eae9b0dac40babe Mon Sep 17 00:00:00 2001 From: Elliot Ronaghan Date: Sat, 11 Mar 2017 22:29:27 -0800 Subject: [PATCH 2/4] Add base.c and chapel.c allocators to EXTRA_DIST Same intent as 04dee4e, but adds individual files to avoid adding .deps to the release tarball (also follows existing pattern for adding things to EXTRA_DIST) --- src/Makefile.am | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Makefile.am b/src/Makefile.am index 43868a272..3d162f9c8 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -106,6 +106,8 @@ EXTRA_DIST += \ barrier/array.c \ barrier/log.c \ barrier/sinc.c \ + alloc/base.c \ + alloc/chapel.c \ affinity/common.c \ affinity/hwloc.c \ affinity/binders.c \ From 9c156c67cf8ebcf19ceee935817843ea5c8ebe47 Mon Sep 17 00:00:00 2001 From: Elliot Ronaghan Date: Sat, 11 Mar 2017 22:32:16 -0800 Subject: [PATCH 3/4] Fix chapel.c allocator Bring in qthread-int.h for uint_fast16_t. CHPL_MEM=jemalloc happened to bring in uint_fast16_t, but CHPL_MEM=cstdlib doesn't, so compilation was failing. Longer term, I think it'd be nice to switch alignment from a uint_fast16_t to size_t and change the signature to match the standard memalign or aligned_alloc routines. i.e. change: void *qt_internal_aligned_alloc(size_t alloc_size, uint_fast16_t alignment) void qt_internal_aligned_free(void *ptr, uint_fast16_t alignment) to void *qt_aligned_alloc(size_t alignment, size_t size) void qt_aligned_free(void *ptr, size_t alignment) --- src/alloc/chapel.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/alloc/chapel.c b/src/alloc/chapel.c index 3f3c0e497..c8e1ad0f2 100644 --- a/src/alloc/chapel.c +++ b/src/alloc/chapel.c @@ -13,6 +13,8 @@ static QINLINE int getpagesize() } #endif +#include /* for uint_fast16_t */ + #include "chpl-mem-impl.h" void *qt_malloc(size_t size){ From 1699c31d11dfd562f5accceb0ca5ce7d22bc50a0 Mon Sep 17 00:00:00 2001 From: Elliot Ronaghan Date: Sat, 11 Mar 2017 22:51:50 -0800 Subject: [PATCH 4/4] Quiet 'visibility' warning for qthread_tos() and qthread_bos() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Quiet "‘visibility’ attribute ignored on non-class types" warnings for qthread_tos() and qthread_bos(). I think this change should be made for all functions, but these are the only ones that currently produce the warning. See #50 for more info --- src/qthread.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qthread.c b/src/qthread.c index 8aa5cdcd2..36dce6815 100644 --- a/src/qthread.c +++ b/src/qthread.c @@ -1881,7 +1881,7 @@ unsigned API_FUNC qthread_size_tasklocal(void) return f->rdata->tasklocal_size ? f->rdata->tasklocal_size : qlib->qthread_tasklocal_size; } /*}}}*/ -void* API_FUNC qthread_tos(void) +API_FUNC void* qthread_tos(void) { const qthread_t *f = qthread_internal_self(); @@ -1889,7 +1889,7 @@ void* API_FUNC qthread_tos(void) } -void* API_FUNC qthread_bos(void) +API_FUNC void* qthread_bos(void) { const qthread_t *f = qthread_internal_self();