#include "tile/base/buffer/polymorphic_buffer.h"

namespace tile {
constexpr PoolType PoolTraits<PolymorphicBuffer>::kType;
constexpr std::size_t PoolTraits<PolymorphicBuffer>::kLowWaterMark;
constexpr std::size_t PoolTraits<PolymorphicBuffer>::kHighWaterMark;
constexpr std::chrono::seconds PoolTraits<PolymorphicBuffer>::kMaxIdle;
constexpr std::size_t PoolTraits<PolymorphicBuffer>::kMinimumThreadCacheSize;
constexpr std::size_t PoolTraits<PolymorphicBuffer>::kTransferBatchSize;

void
PoolTraits<PolymorphicBuffer>::OnPut(PolymorphicBuffer *bb)
{
    bb->Clear();
}

namespace detail {
void
PolymorphicBufferBlockDeleter ::operator()(PolymorphicBufferBlock *p)
{
    TILE_DCHECK_EQ(p->UnsafeRefCount(), 0);
    p->Destroy();
}
}// namespace detail
}// namespace tile
