* The mapping is now also removed from the area list in case creating the
area failed. * "base" is no longer used uninitialized in combination with B_BASE_ADDRESS. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17304 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -68,6 +68,7 @@ ServerMemoryAllocator::AddArea(area_id serverArea, area_id& _area, uint8*& _base
|
|||||||
}
|
}
|
||||||
|
|
||||||
status_t status = B_ERROR;
|
status_t status = B_ERROR;
|
||||||
|
uint32 addressSpec = B_ANY_ADDRESS;
|
||||||
void* base;
|
void* base;
|
||||||
#ifndef HAIKU_TARGET_PLATFORM_LIBBE_TEST
|
#ifndef HAIKU_TARGET_PLATFORM_LIBBE_TEST
|
||||||
if (!readOnly) {
|
if (!readOnly) {
|
||||||
@@ -75,15 +76,18 @@ ServerMemoryAllocator::AddArea(area_id serverArea, area_id& _area, uint8*& _base
|
|||||||
base = (void*)0x60000000;
|
base = (void*)0x60000000;
|
||||||
status = _kern_reserve_heap_address_range((addr_t*)&base,
|
status = _kern_reserve_heap_address_range((addr_t*)&base,
|
||||||
B_BASE_ADDRESS, 128 * 1024 * 1024);
|
B_BASE_ADDRESS, 128 * 1024 * 1024);
|
||||||
|
addressSpec = status == B_OK ? B_EXACT_ADDRESS : B_BASE_ADDRESS;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
mapping->local_area = clone_area(readOnly ? "server read-only memory" : "server_memory",
|
mapping->local_area = clone_area(readOnly ? "server read-only memory" : "server_memory",
|
||||||
&base, status == B_OK ? B_EXACT_ADDRESS : B_BASE_ADDRESS,
|
&base, addressSpec, B_READ_AREA | (readOnly ? 0 : B_WRITE_AREA), serverArea);
|
||||||
B_READ_AREA | (readOnly ? 0 : B_WRITE_AREA), serverArea);
|
|
||||||
if (mapping->local_area < B_OK) {
|
if (mapping->local_area < B_OK) {
|
||||||
status = mapping->local_area;
|
status = mapping->local_area;
|
||||||
|
|
||||||
|
fAreas.RemoveItem(mapping);
|
||||||
delete mapping;
|
delete mapping;
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user