• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Compiling Tfs 1.5, 8.0, ubuntu 24.04 nekiro alloc_traits.h output message error

src/lockfree.h

It's a really short file so you'll figure out where to paste it

C++:
template <typename T, size_t Capacity>
class LockfreePoolingAllocator
{
public:
    template <class U>
    struct rebind
    {
        using other = LockfreePoolingAllocator<U, Capacity>;
    };

    LockfreePoolingAllocator() = default;

    template <typename U>
    explicit constexpr LockfreePoolingAllocator(const LockfreePoolingAllocator<U, Capacity>&)
    {}
    using value_type = T;

    T* allocate(size_t) const
    {
        auto& inst = LockfreeFreeList<sizeof(T), Capacity>::get();
        void* p; // NOTE: p doesn't have to be initialized
        if (!inst.pop(p)) {
            // Acquire memory without calling the constructor of T
            p = operator new(sizeof(T));
        }
        return static_cast<T*>(p);
    }

    void deallocate(T* p, size_t) const
    {
        auto& inst = LockfreeFreeList<sizeof(T), Capacity>::get();
        if (!inst.bounded_push(p)) {
            // Release memory without calling the destructor of T
            //(it has already been called at this point)
            operator delete(p);
        }
    }
};
 
src/lockfree.h

It's a really short file so you'll figure out where to paste it

C++:
template <typename T, size_t Capacity>
class LockfreePoolingAllocator
{
public:
    template <class U>
    struct rebind
    {
        using other = LockfreePoolingAllocator<U, Capacity>;
    };

    LockfreePoolingAllocator() = default;

    template <typename U>
    explicit constexpr LockfreePoolingAllocator(const LockfreePoolingAllocator<U, Capacity>&)
    {}
    using value_type = T;

    T* allocate(size_t) const
    {
        auto& inst = LockfreeFreeList<sizeof(T), Capacity>::get();
        void* p; // NOTE: p doesn't have to be initialized
        if (!inst.pop(p)) {
            // Acquire memory without calling the constructor of T
            p = operator new(sizeof(T));
        }
        return static_cast<T*>(p);
    }

    void deallocate(T* p, size_t) const
    {
        auto& inst = LockfreeFreeList<sizeof(T), Capacity>::get();
        if (!inst.bounded_push(p)) {
            // Release memory without calling the destructor of T
            //(it has already been called at this point)
            operator delete(p);
        }
    }
};

Help a loooot, thank you, engine compiled, and showing now this.
I changed second
LUA:
%02d:%02d:%02d
, to
Code:
%02d:%02d:%04d
.
There is only one place to change this, on like 369:46, nothing more.

ots compilation tools.cpp format date.webp
 
and showing now this.
Increase buffer size to some bigger value ex. 120:
Code:
char buffer[120];
in:

EDIT:
Someone posted before me - within a minute - to increase buffer to 72 bytes, which is right value, but 120 bytes or any other higher value will work. It looks that user was banned, probably for AI content or other violations.
 
Last edited:
@dami1310 + @Gesior.pl.

perfection.webp
Thank you ❤️
Post automatically merged:

Increase buffer size to some bigger value ex. 120:
Code:
char buffer[120];
in:

EDIT:
Someone posted before me - within a minute - to increase buffer to 72 bytes, which is right value, but 120 bytes or any other higher value will work. It looks that user was banned, probably for AI content or other violations.
"Independent" source changes, was giving still error, which was still blocking compiling.

That was "Independent", he was talking about open source, which is the wrong way..
I don't even have any questions, how that happen.
 
Last edited:
Back
Top