From 3ec7fa7c7a55826ee74869a3709a683f8f5a470d Mon Sep 17 00:00:00 2001 From: fireice-uk Date: Tue, 17 Oct 2017 20:04:56 +0100 Subject: make hwloc check capabilities and stop it from leaking mem --- xmrstak/backend/cpu/hwlocMemory.hpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'xmrstak/backend/cpu') 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 -- cgit v1.1