mirror of
https://github.com/mmueller41/genode.git
synced 2026-01-21 20:42:56 +01:00
allocator avl: exception if metadata assign fails
The Allocator_avl_tpl::metadata method (assigning variant) may fail silently. Change this to make debugging easier. Ref #2490
This commit is contained in:
committed by
Christian Helmuth
parent
0778a0f700
commit
b2624be2ad
@@ -311,6 +311,8 @@ class Genode::Allocator_avl_tpl : public Allocator_avl_base
|
||||
|
||||
public:
|
||||
|
||||
struct Assign_metadata_failed : Exception { };
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
@@ -335,11 +337,14 @@ class Genode::Allocator_avl_tpl : public Allocator_avl_base
|
||||
|
||||
/**
|
||||
* Assign custom meta data to block at specified address
|
||||
*
|
||||
* \throw Assign_metadata_failed
|
||||
*/
|
||||
void metadata(void *addr, BMDT bmd) const
|
||||
{
|
||||
Block *b = static_cast<Block *>(_find_by_address((addr_t)addr));
|
||||
if (b) *static_cast<BMDT *>(b) = bmd;
|
||||
else throw Assign_metadata_failed();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user