status_t VMUserAddressSpace::ReserveAddressRange(void** _address, uint32 addressSpec, size_t size, uint32 flags, uint32 allocationFlags) { // check to see if this address space has entered DELETE state if (fDeleting) { // okay, someone is trying to delete this address space now, so we // can't insert the area, let's back out return B_BAD_TEAM_ID; } VMUserArea* area = VMUserArea::CreateReserved(this, flags, allocationFlags); if (area == NULL) return B_NO_MEMORY; status_t status = InsertArea(_address, addressSpec, size, area, allocationFlags); if (status != B_OK) { area->~VMUserArea(); free_etc(area, allocationFlags); return status; } area->cache_offset = area->Base(); // we cache the original base address here Get(); return B_OK; }
BOOL CPlotPane::InsertNewArea(UINT uiAreaIndex, BOOL bLogY_Axis) { UINT uiDummyNewAreaIndex; // Dummy because it will be wherever we inserted it. BOOL bSuccess = TRUE; InsertArea(uiAreaIndex, &uiDummyNewAreaIndex); SetLogY(uiDummyNewAreaIndex, bLogY_Axis); return(bSuccess); }
/** * Function AddArea * Add an empty copper area to board areas list * @param aNewZonesList = a PICKED_ITEMS_LIST * where to store new areas pickers (useful * in undo commands) can be NULL * @param aNetcode = the necode of the copper area (0 = no net) * @param aLayer = the layer of area * @param aStartPointPosition = position of the first point of the polygon outline of this area * @param aHatch = hacth option * @return pointer to the new area */ ZONE_CONTAINER* BOARD::AddArea( PICKED_ITEMS_LIST* aNewZonesList, int aNetcode, int aLayer, wxPoint aStartPointPosition, int aHatch ) { ZONE_CONTAINER* new_area = InsertArea( aNetcode, m_ZoneDescriptorList.size( ) - 1, aLayer, aStartPointPosition.x, aStartPointPosition.y, aHatch ); if( aNewZonesList ) { ITEM_PICKER picker( new_area, UR_NEW ); aNewZonesList->PushItem( picker ); } return new_area; }