base: sanity check for slab element allocation

Issue #1039
This commit is contained in:
Alexander Boettcher 2016-11-24 10:40:15 +01:00 committed by Christian Helmuth
parent b8f9f92731
commit c83eb515f9
1 changed files with 8 additions and 0 deletions

View File

@ -314,6 +314,14 @@ void Slab::insert_sb(void *ptr)
bool Slab::alloc(size_t size, void **out_addr)
{
/* too large for us ? */
if (size > _slab_size) {
Genode::error("requested size ", size, " is larger then slab size ",
_slab_size);
return false;
}
/*
* If we run out of slab, we need to allocate a new slab block. For the
* special case that this block is allocated using the allocator that by