mirror of
https://github.com/mmueller41/mxtasking.git
synced 2026-01-21 12:42:57 +01:00
Added error handling for illegal NUMA nodes in memory allocator.
This commit is contained in:
@@ -38,6 +38,8 @@ public:
|
|||||||
|
|
||||||
inline void *local_allocate(const std::uint8_t numa_node_id, const std::size_t size)
|
inline void *local_allocate(const std::uint8_t numa_node_id, const std::size_t size)
|
||||||
{
|
{
|
||||||
|
if (heaps[numa_node_id] == nullptr)
|
||||||
|
Genode::error("No local heap for NUMA node ", numa_node_id);
|
||||||
return heaps[numa_node_id]->alloc(size);
|
return heaps[numa_node_id]->alloc(size);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -95,6 +97,8 @@ public:
|
|||||||
{
|
{
|
||||||
void *ptr = nullptr;
|
void *ptr = nullptr;
|
||||||
posix_memalign(&ptr, 64, alignment_helper::next_multiple(size, 64UL));
|
posix_memalign(&ptr, 64, alignment_helper::next_multiple(size, 64UL));
|
||||||
|
if (!ptr)
|
||||||
|
Genode::error("posix_memalign returned NULL");
|
||||||
return ptr;
|
return ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user