<commit_before>#include "tile_cache.hpp"

namespace yg
{
  TileCache::TileCache(size_t tileMemSize, size_t memSize)
    : m_cache(log(memSize / tileMemSize) / log(2))
  {
  }

  void TileCache::addTile(Tiler::RectInfo const & key, Tile const & value)
  {
    bool found;
    Tile & cachedVal = m_cache.Find(key.toUInt64Cell(), found);
    cachedVal = value;
  }

  void TileCache::lock()
  {
    m_mutex.Lock();
  }

  void TileCache::unlock()
  {
    m_mutex.Unlock();
  }

  bool TileCache::hasTile(Tiler::RectInfo const & key)
  {<commit_msg>msvc compilation fixes.<commit_after>#include "tile_cache.hpp"

#include "../std/cmath.hpp"


namespace yg
{
  TileCache::TileCache(size_t tileMemSize, size_t memSize)
    : m_cache(log(memSize / static_cast<double>(tileMemSize)) / log(2.0))
  {
  }

  void TileCache::addTile(Tiler::RectInfo const & key, Tile const & value)
  {
    bool found;
    Tile & cachedVal = m_cache.Find(key.toUInt64Cell(), found);
    cachedVal = value;
  }

  void TileCache::lock()
  {
    m_mutex.Lock();
  }

  void TileCache::unlock()
  {
    m_mutex.Unlock();
  }

  bool TileCache::hasTile(Tiler::RectInfo const & key)
  {
{'fraction_non_alphanumeric': 0.14397224631396358, 'fraction_numerical': 0.006071118820468344, 'mean_word_length': 3.616, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7012807', 'n_tokens_mistral': 450, 'n_tokens_neox': 433, 'n_words': 76}