summaryrefslogtreecommitdiffstats
path: root/xmrstak/backend/cpu
diff options
context:
space:
mode:
authorfireice-uk <fireice-uk@users.noreply.github.com>2017-10-17 20:04:56 +0100
committerfireice-uk <fireice-uk@users.noreply.github.com>2017-10-17 20:04:56 +0100
commit3ec7fa7c7a55826ee74869a3709a683f8f5a470d (patch)
treee89763c4ccf0cbd87afc145c3e985dc5ec7b7933 /xmrstak/backend/cpu
parentdcd176ada4ed631b0ea2b2762d93d9be3e4307d4 (diff)
downloadxmr-stak-3ec7fa7c7a55826ee74869a3709a683f8f5a470d.zip
xmr-stak-3ec7fa7c7a55826ee74869a3709a683f8f5a470d.tar.gz
make hwloc check capabilities and stop it from leaking mem
Diffstat (limited to 'xmrstak/backend/cpu')
-rw-r--r--xmrstak/backend/cpu/hwlocMemory.hpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/xmrstak/backend/cpu/hwlocMemory.hpp b/xmrstak/backend/cpu/hwlocMemory.hpp
index 719c1bb..69742be 100644
--- a/xmrstak/backend/cpu/hwlocMemory.hpp
+++ b/xmrstak/backend/cpu/hwlocMemory.hpp
@@ -21,6 +21,13 @@ void bindMemoryToNUMANode( size_t puId )
hwloc_topology_init(&topology);
hwloc_topology_load(topology);
+ if(!hwloc_topology_get_support(topology)->membind->set_thisthread_membind)
+ {
+ printer::inst()->print_msg(L0, "hwloc: set_thisthread_membind not supported");
+ hwloc_topology_destroy(topology);
+ return;
+ }
+
depth = hwloc_get_type_depth(topology, HWLOC_OBJ_PU);
for( size_t i = 0;
@@ -45,6 +52,8 @@ void bindMemoryToNUMANode( size_t puId )
}
}
}
+
+ hwloc_topology_destroy(topology);
}
#else
OpenPOWER on IntegriCloud