Пример #1
0
mlock_allocator::~mlock_allocator()
   {
   if(m_pool)
      {
      secure_scrub_memory(m_pool, m_poolsize);
      OS::free_locked_pages(m_pool, m_poolsize);
      m_pool = nullptr;
      }
   }
Пример #2
0
void Compression_Alloc_Info::do_free(void* ptr)
   {
   if(ptr)
      {
      auto i = m_current_allocs.find(ptr);

      if(i == m_current_allocs.end())
         throw Exception("Compression_Alloc_Info::free got pointer not allocated by us");

      secure_scrub_memory(ptr, i->second);
      std::free(ptr);
      m_current_allocs.erase(i);
      }
   }