mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-06 11:39:49 -06:00
Working version that still bypasses memorypools
This commit is contained in:
@@ -83,8 +83,14 @@ Connection::Connection(std::unique_ptr<ghoul::io::Socket> s,
|
||||
|
||||
_topicFactory.registerClass(
|
||||
AuthenticationTopicKey,
|
||||
[password](bool, const ghoul::Dictionary&) {
|
||||
return new AuthorizationTopic(password);
|
||||
[password](bool, const ghoul::Dictionary&, ghoul::MemoryPoolBase* pool) {
|
||||
if (pool) {
|
||||
void* ptr = pool->alloc(sizeof(AuthorizationTopic));
|
||||
return new (ptr) AuthorizationTopic(password);
|
||||
}
|
||||
else {
|
||||
return new AuthorizationTopic(password);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
@@ -78,22 +78,41 @@ void SyncModule::internalInitialize(const ghoul::Dictionary& configuration) {
|
||||
|
||||
fSynchronization->registerClass(
|
||||
"HttpSynchronization",
|
||||
[this](bool, const ghoul::Dictionary& dictionary) {
|
||||
return new HttpSynchronization(
|
||||
dictionary,
|
||||
_synchronizationRoot,
|
||||
_synchronizationRepositories
|
||||
);
|
||||
[this](bool, const ghoul::Dictionary& dictionary, ghoul::MemoryPoolBase* pool) {
|
||||
if (pool) {
|
||||
void* ptr = pool->alloc(sizeof(HttpSynchronization));
|
||||
return new (ptr) HttpSynchronization(
|
||||
dictionary,
|
||||
_synchronizationRoot,
|
||||
_synchronizationRepositories
|
||||
);
|
||||
}
|
||||
else {
|
||||
return new HttpSynchronization(
|
||||
dictionary,
|
||||
_synchronizationRoot,
|
||||
_synchronizationRepositories
|
||||
);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
fSynchronization->registerClass(
|
||||
"UrlSynchronization",
|
||||
[this](bool, const ghoul::Dictionary& dictionary) {
|
||||
return new UrlSynchronization(
|
||||
dictionary,
|
||||
_synchronizationRoot
|
||||
);
|
||||
[this](bool, const ghoul::Dictionary& dictionary, ghoul::MemoryPoolBase* pool) {
|
||||
if (pool) {
|
||||
void* ptr = pool->alloc(sizeof(UrlSynchronization));
|
||||
return new (ptr) UrlSynchronization(
|
||||
dictionary,
|
||||
_synchronizationRoot
|
||||
);
|
||||
}
|
||||
else {
|
||||
return new UrlSynchronization(
|
||||
dictionary,
|
||||
_synchronizationRoot
|
||||
);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user