Commit 24975f88 authored by Andrey Kamakin's avatar Andrey Kamakin

Added compile time switch for hash tables.

Ref T8874
parent 0ff58df2
......@@ -169,6 +169,10 @@ option(HIDE_SAFE_ASSERTS "Don't show message box for \"safe\" asserts, just igno
configure_file(config-hide-safe-asserts.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-hide-safe-asserts.h)
add_feature_info("Safe Asserts" HIDE_SAFE_ASSERTS "Don't show message box for \"safe\" asserts, just ignore them automatically and dump a message to the terminal.")
option(USE_LOCK_FREE_HASH_TABLE "Use lock free hash table instead of blocking." ON)
configure_file(config-hash-table-implementaion.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-hash-table-implementaion.h)
add_feature_info("Lock free hash table" USE_LOCK_FREE_HASH_TABLE "Use lock free hash table instead of blocking.")
option(FOUNDATION_BUILD "A Foundation build is a binary release build that can package some extra things like color themes. Linux distributions that build and install Krita into a default system location should not define this option to true." OFF)
add_feature_info("Foundation Build" FOUNDATION_BUILD "A Foundation build is a binary release build that can package some extra things like color themes. Linux distributions that build and install Krita into a default system location should not define this option to true.")
......
......@@ -22,8 +22,7 @@
#include <QList>
#include "kis_memento_item.h"
//#include "kis_tile_hash_table.h"
#include "kis_tile_hash_table2.h"
#include "config-hash-table-implementaion.h"
typedef QList<KisMementoItemSP> KisMementoItemList;
typedef QListIterator<KisMementoItemSP> KisMementoItemListIterator;
......@@ -39,19 +38,19 @@ typedef QList<KisHistoryItem> KisHistoryList;
class KisMemento;
typedef KisSharedPtr<KisMemento> KisMementoSP;
template <class T>
class KisTileHashTableTraits2;
template <class T>
class KisTileHashTableIteratorTraits2;
//typedef KisTileHashTableTraits<KisMementoItem> KisMementoItemHashTable;
//typedef KisTileHashTableIteratorTraits<KisMementoItem, QWriteLocker> KisMementoItemHashTableIterator;
//typedef KisTileHashTableIteratorTraits<KisMementoItem, QReadLocker> KisMementoItemHashTableIteratorConst;
#ifdef USE_LOCK_FREE_HASH_TABLE
#include "kis_tile_hash_table2.h"
typedef KisTileHashTableTraits2<KisMementoItem> KisMementoItemHashTable;
typedef KisTileHashTableIteratorTraits2<KisMementoItem> KisMementoItemHashTableIterator;
typedef KisTileHashTableIteratorTraits2<KisMementoItem> KisMementoItemHashTableIteratorConst;
#else
#include "kis_tile_hash_table.h"
typedef KisTileHashTableTraits<KisMementoItem> KisMementoItemHashTable;
typedef KisTileHashTableIteratorTraits<KisMementoItem, QWriteLocker> KisMementoItemHashTableIterator;
typedef KisTileHashTableIteratorTraits<KisMementoItem, QReadLocker> KisMementoItemHashTableIteratorConst;
#endif // USE_LOCK_FREE_HASH_TABLE
class KRITAIMAGE_EXPORT KisMementoManager
......
......@@ -23,7 +23,6 @@
#include "kis_tile.h"
/**
* This is a template for a hash table that stores tiles (or some other
* objects resembling tiles). Actually, this object should only have
......
......@@ -25,12 +25,17 @@
#include <kis_shared.h>
#include <kis_shared_ptr.h>
#include "config-hash-table-implementaion.h"
//#include "kis_debug.h"
#include "kritaimage_export.h"
//#include "kis_tile_hash_table.h"
#ifdef USE_LOCK_FREE_HASH_TABLE
#include "kis_tile_hash_table2.h"
#else
#include "kis_tile_hash_table.h"
#endif // USE_LOCK_FREE_HASH_TABLE
#include "kis_memento_manager.h"
#include "kis_memento.h"
#include "KisTiledExtentManager.h"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment