From 0d3b1e2959bdf303c9e60bc9d3940e51e5e3e1d1 Mon Sep 17 00:00:00 2001 From: MikalaiR Date: Sat, 7 May 2016 15:38:25 +0000 Subject: dbx_lmdb: optimization git-svn-id: http://svn.miranda-ng.org/main/trunk@16813 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Dbx_mdb/src/stdafx.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'plugins/Dbx_mdb/src/stdafx.h') diff --git a/plugins/Dbx_mdb/src/stdafx.h b/plugins/Dbx_mdb/src/stdafx.h index 4de6e9fd39..ebb0c8cc7f 100644 --- a/plugins/Dbx_mdb/src/stdafx.h +++ b/plugins/Dbx_mdb/src/stdafx.h @@ -43,6 +43,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "lmdb\lmdb.h" +#ifndef thread_local +# define thread_local __declspec(thread) +#endif + + class txn_ptr { MDB_txn *m_txn; @@ -79,7 +84,7 @@ class txn_ptr_ro { MDB_txn *m_txn; public: - __forceinline txn_ptr_ro(MDB_txn *&txn) : m_txn(txn) + __forceinline txn_ptr_ro(MDB_txn *txn) : m_txn(txn) { mdb_txn_renew(m_txn); } @@ -114,7 +119,7 @@ class cursor_ptr_ro { MDB_cursor *m_cursor; public: - __forceinline cursor_ptr_ro(MDB_cursor *&cursor) : m_cursor(cursor) + __forceinline cursor_ptr_ro(MDB_cursor *cursor) : m_cursor(cursor) { mdb_cursor_renew(mdb_cursor_txn(m_cursor), m_cursor); //-- } -- cgit v1.2.3