commit newest tfs branch only for compare

This commit is contained in:
ErikasKontenis
2020-01-02 19:39:21 +02:00
parent 0b0624a20b
commit 1f7dcd7347
160 changed files with 24900 additions and 10996 deletions

View File

@@ -1,6 +1,6 @@
/**
* Tibia GIMUD Server - a free and open-source MMORPG server emulator
* Copyright (C) 2019 Sabrehaven and Mark Samman <mark.samman@gmail.com>
* The Forgotten Server - a free and open-source MMORPG server emulator
* Copyright (C) 2019 Mark Samman <mark.samman@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -29,14 +29,6 @@ extern Scheduler g_scheduler;
const uint16_t OUTPUTMESSAGE_FREE_LIST_CAPACITY = 2048;
const std::chrono::milliseconds OUTPUTMESSAGE_AUTOSEND_DELAY {10};
class OutputMessageAllocator
{
public:
typedef OutputMessage value_type;
template<typename U>
struct rebind {typedef LockfreePoolingAllocator<U, OUTPUTMESSAGE_FREE_LIST_CAPACITY> other;};
};
void OutputMessagePool::scheduleSendAll()
{
auto functor = std::bind(&OutputMessagePool::sendAll, this);
@@ -79,5 +71,7 @@ void OutputMessagePool::removeProtocolFromAutosend(const Protocol_ptr& protocol)
OutputMessage_ptr OutputMessagePool::getOutputMessage()
{
return std::allocate_shared<OutputMessage>(OutputMessageAllocator());
// LockfreePoolingAllocator<void,...> will leave (void* allocate) ill-formed because
// of sizeof(T), so this guaranatees that only one list will be initialized
return std::allocate_shared<OutputMessage>(LockfreePoolingAllocator<void, OUTPUTMESSAGE_FREE_LIST_CAPACITY>());
}