Update Ghoul repository

Adapt to Ghoul changes in MemoryPool
This commit is contained in:
Alexander Bock
2020-08-19 16:19:25 +02:00
parent 2621e16ec4
commit 6ac5d536fa
7 changed files with 12 additions and 12 deletions

View File

@@ -121,7 +121,7 @@ public:
* and all of the property & asset changes that were made since startup.
*/
void saveCurrentSettingsToProfile(const properties::PropertyOwner& rootOwner,
const std::string& currentTime,
std::string currentTime,
interaction::NavigationHandler::NavigationState navState);
/// If the value passed to this function is 'true', the addAsset and removeAsset

View File

@@ -35,10 +35,8 @@ public:
ghoul::MemoryPool<8 * 1024 * 1024, false> PersistentMemory;
// This should be replaced with a std::pmr::memory_resource wrapper around our own
// Memory pool. Resetting the monotoic_buffer_resource costs an allocation, that we
// can prevent
std::pmr::monotonic_buffer_resource TemporaryMemory =
std::pmr::monotonic_buffer_resource(100 * 4096);
// Memory pool so that we can get a high-water mark out of it
ghoul::MemoryPool<100 * 4096, false> TemporaryMemory;
};
} // namespace openspace

View File

@@ -85,7 +85,7 @@ Connection::Connection(std::unique_ptr<ghoul::io::Socket> s,
AuthenticationTopicKey,
[password](bool, const ghoul::Dictionary&, ghoul::MemoryPoolBase* pool) {
if (pool) {
void* ptr = pool->alloc(sizeof(AuthorizationTopic));
void* ptr = pool->allocate(sizeof(AuthorizationTopic));
return new (ptr) AuthorizationTopic(password);
}
else {

View File

@@ -80,7 +80,7 @@ void SyncModule::internalInitialize(const ghoul::Dictionary& configuration) {
"HttpSynchronization",
[this](bool, const ghoul::Dictionary& dictionary, ghoul::MemoryPoolBase* pool) {
if (pool) {
void* ptr = pool->alloc(sizeof(HttpSynchronization));
void* ptr = pool->allocate(sizeof(HttpSynchronization));
return new (ptr) HttpSynchronization(
dictionary,
_synchronizationRoot,
@@ -101,7 +101,7 @@ void SyncModule::internalInitialize(const ghoul::Dictionary& configuration) {
"UrlSynchronization",
[this](bool, const ghoul::Dictionary& dictionary, ghoul::MemoryPoolBase* pool) {
if (pool) {
void* ptr = pool->alloc(sizeof(UrlSynchronization));
void* ptr = pool->allocate(sizeof(UrlSynchronization));
return new (ptr) UrlSynchronization(
dictionary,
_synchronizationRoot

View File

@@ -1062,7 +1062,7 @@ void OpenSpaceEngine::preSynchronization() {
FileSys.triggerFilesystemEvents();
// Reset the temporary, frame-based storage
global::memoryManager.TemporaryMemory.release();
global::memoryManager.TemporaryMemory.reset();
if (_hasScheduledAssetLoading) {
LINFO(fmt::format("Loading asset: {}", _scheduledAssetPathToLoad));
@@ -1260,6 +1260,8 @@ void OpenSpaceEngine::postDraw() {
_isFirstRenderingFirstFrame = false;
}
global::memoryManager.PersistentMemory.housekeeping();
LTRACE("OpenSpaceEngine::postDraw(end)");
}

View File

@@ -454,7 +454,7 @@ namespace {
} // namespace
void Profile::saveCurrentSettingsToProfile(const properties::PropertyOwner& rootOwner,
const std::string& currentTime,
std::string currentTime,
interaction::NavigationHandler::NavigationState navState)
{
version = Profile::CurrentVersion;
@@ -476,7 +476,7 @@ void Profile::saveCurrentSettingsToProfile(const properties::PropertyOwner& root
// add current time to profile file
//
Time t;
t.time = currentTime;
t.time = std::move(currentTime);
t.type = Time::Type::Absolute;
time = std::move(t);