Kaydet (Commit) a078328e authored tarafından Kohei Yoshida's avatar Kohei Yoshida Kaydeden (comit) Kohei Yoshida

tdf#107945: prepare for future multi-threading of pivot cache...

It's disabled for now. We need to first make the edit engine and
a few other places thread-safe before we can parallelize this code.

Change-Id: Ie09536964ece42d43f505afc5e2611d469cc5c95
Reviewed-on: https://gerrit.libreoffice.org/38424Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarKohei Yoshida <libreoffice@kohei.us>
üst 59c0682c
......@@ -112,6 +112,12 @@ $(eval $(call gb_CppunitTest_add_libs,sc_ucalc,\
))
endif
ifeq ($(OS), $(filter LINUX %BSD SOLARIS, $(OS)))
$(eval $(call gb_CppunitTest_add_libs,sc_ucalc,\
-lpthread \
))
endif
$(eval $(call gb_CppunitTest_use_configuration,sc_ucalc))
# vim: set noet sw=4 ts=4:
......@@ -696,6 +696,12 @@ $(eval $(call gb_Library_add_libs,sc,\
))
endif
ifeq ($(OS), $(filter LINUX %BSD SOLARIS, $(OS)))
$(eval $(call gb_Library_add_libs,sc,\
-lpthread \
))
endif
$(eval $(call gb_SdiTarget_SdiTarget,sc/sdi/scslots,sc/sdi/scalc))
$(eval $(call gb_SdiTarget_set_include,sc/sdi/scslots,\
......
......@@ -42,9 +42,9 @@ struct ScDPNumGroupInfo;
*/
class SC_DLLPUBLIC ScDPCache
{
typedef std::unordered_set<OUString, OUStringHash> StringSetType;
public:
typedef std::unordered_set<OUString, OUStringHash> StringSetType;
typedef mdds::flat_segment_tree<SCROW, bool> EmptyRowsType;
typedef std::vector<ScDPItemData> ScDPItemDataVec;
typedef std::set<ScDPObject*> ScDPObjectSet;
typedef std::vector<SCROW> IndexArrayType;
......@@ -117,17 +117,17 @@ private:
FieldsType maFields;
GroupFieldsType maGroupFields;
StringSetType maStringPool;
std::vector<StringSetType> maStringPools; // one for each field.
std::vector<OUString> maLabelNames; // Stores dimension names and the data layout dimension name at position 0.
mdds::flat_segment_tree<SCROW, bool> maEmptyRows;
EmptyRowsType maEmptyRows;
SCROW mnDataSize;
SCROW mnRowCount;
bool mbDisposing;
public:
rtl_uString* InternString( const OUString& rStr );
rtl_uString* InternString( size_t nDim, const OUString& rStr );
void AddReference(ScDPObject* pObj) const;
void RemoveReference(ScDPObject* pObj) const;
const ScDPObjectSet& GetAllReferences() const;
......
This diff is collapsed.
......@@ -247,7 +247,9 @@ void DBConnector::getValue(long nCol, ScDPItemData &rData, short& rNumType) cons
case sdbc::DataType::VARBINARY:
case sdbc::DataType::LONGVARBINARY:
default:
rData.SetStringInterned(mrCache.InternString(mxRow->getString(nCol+1)));
// nCol is 0-based, and the left-most column always has nCol == 0.
rData.SetStringInterned(
mrCache.InternString(nCol, mxRow->getString(nCol+1)));
}
}
catch (uno::Exception&)
......
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