mirror of
https://github.com/genodelabs/genode.git
synced 2025-06-06 01:11:46 +00:00
parent
b893968232
commit
22c1f8772b
@ -172,6 +172,9 @@ Ram_dataspace_capability Ram_session_component::alloc(size_t ds_size, bool cache
|
|||||||
Dataspace_component(ds_size, (addr_t)ds_addr, !cached, true, this);
|
Dataspace_component(ds_size, (addr_t)ds_addr, !cached, true, this);
|
||||||
} catch (Allocator::Out_of_memory) {
|
} catch (Allocator::Out_of_memory) {
|
||||||
PWRN("Could not allocate metadata");
|
PWRN("Could not allocate metadata");
|
||||||
|
/* cleanup unneeded resources */
|
||||||
|
_ram_alloc->free(ds_addr);
|
||||||
|
|
||||||
throw Out_of_metadata();
|
throw Out_of_metadata();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -182,15 +185,24 @@ Ram_dataspace_capability Ram_session_component::alloc(size_t ds_size, bool cache
|
|||||||
*/
|
*/
|
||||||
_clear_ds(ds);
|
_clear_ds(ds);
|
||||||
|
|
||||||
|
/* create native shared memory representation of dataspace */
|
||||||
|
try {
|
||||||
|
_export_ram_ds(ds);
|
||||||
|
} catch (Out_of_metadata) {
|
||||||
|
PWRN("could not export RAM dataspace of size 0x%zx", ds->size());
|
||||||
|
/* cleanup unneeded resources */
|
||||||
|
destroy(&_ds_slab, ds);
|
||||||
|
_ram_alloc->free(ds_addr);
|
||||||
|
|
||||||
|
throw Quota_exceeded();
|
||||||
|
}
|
||||||
|
|
||||||
if (verbose)
|
if (verbose)
|
||||||
PDBG("ds_size=%zu, used_quota=%zu quota_limit=%zu",
|
PDBG("ds_size=%zu, used_quota=%zu quota_limit=%zu",
|
||||||
ds_size, used_quota(), _quota_limit);
|
ds_size, used_quota(), _quota_limit);
|
||||||
|
|
||||||
Dataspace_capability result = _ds_ep->manage(ds);
|
Dataspace_capability result = _ds_ep->manage(ds);
|
||||||
|
|
||||||
/* create native shared memory representation of dataspace */
|
|
||||||
_export_ram_ds(ds);
|
|
||||||
|
|
||||||
Lock::Guard lock_guard(_ref_members_lock);
|
Lock::Guard lock_guard(_ref_members_lock);
|
||||||
/* keep track of the used quota for actual payload */
|
/* keep track of the used quota for actual payload */
|
||||||
_payload += ds_size;
|
_payload += ds_size;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user