mirror of
https://github.com/genodelabs/genode.git
synced 2025-04-16 07:27:35 +00: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:
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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user