From 443113383296ca4781fb44e58e018a337db8e73c Mon Sep 17 00:00:00 2001 From: Eike Rathke Date: Mon, 23 Oct 2017 15:12:22 +0200 Subject: Move GetElementsMax() to .cxx Nothing else is using it so we don't need it in .hxx Change-Id: I0df879a7be2c56a70c30f50f44a92bb527b5a9ed --- sc/inc/scmatrix.hxx | 17 ----------------- 1 file changed, 17 deletions(-) (limited to 'sc/inc') diff --git a/sc/inc/scmatrix.hxx b/sc/inc/scmatrix.hxx index c80ce3333ab0..4acd2c937f91 100644 --- a/sc/inc/scmatrix.hxx +++ b/sc/inc/scmatrix.hxx @@ -152,23 +152,6 @@ public: mfFirst(r.mfFirst), mfRest(r.mfRest), mnCount(r.mnCount) {} }; - /// The maximum number of elements a matrix may have at runtime. - static size_t GetElementsMax() - { - // Arbitrarily assuming 12 bytes per element, 8 bytes double plus - // overhead. Stored as an array in an mdds container it's less, but for - // strings or mixed matrix it can be much more.. - constexpr size_t nPerElem = 12; - // Arbitrarily assuming 1GB memory. Could be dynamic at some point. - constexpr size_t nMemMax = 0x40000000; - // With 1GB that's ~85M elements, or 85 whole columns. - constexpr size_t nElemMax = nMemMax / nPerElem; - // With MAXROWCOUNT==1048576 and 128 columns => 128M elements, 1.5GB - constexpr size_t nArbitraryLimit = (size_t)MAXROWCOUNT * 128; - // With the constant 1GB from above that's the actual value. - return nElemMax < nArbitraryLimit ? nElemMax : nArbitraryLimit; - } - /** Checks nC or nR for zero and uses GetElementsMax() whether a matrix of the size of nC*nR could be allocated. A zero size (both nC and nR zero) matrix is allowed for later resize. -- cgit