blob: a52921b9e2dfa5fe5b687e068c9411ccf4c51728 [file] [log] [blame]
//===- RegionFactory.cpp --------------------------------------------------===//
//
// The MCLinker Project
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#include <mcld/Support/RegionFactory.h>
#include <mcld/Support/Space.h>
#include <new>
using namespace mcld;
//===----------------------------------------------------------------------===//
// RegionFactory
//===----------------------------------------------------------------------===//
MemoryRegion*
RegionFactory::produce(Address pVMAStart, size_t pSize)
{
MemoryRegion* result = Alloc::allocate();
new (result) MemoryRegion(pVMAStart, pSize);
return result;
}
void RegionFactory::destruct(MemoryRegion* pRegion)
{
destroy(pRegion);
deallocate(pRegion);
}