1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +03:00

0025746: Excessive memory use in math_Matrix

math_DoubleTab now statically allocates only 16 items for Buf
Removed indirection table from math_DoubleTab
This commit is contained in:
dbv
2015-04-14 18:46:12 +03:00
committed by bugmaster
parent f25b82d624
commit d2d0f00268
3 changed files with 12 additions and 51 deletions

View File

@@ -20,16 +20,14 @@
inline Standard_Real& math_DoubleTab::Value (const Standard_Integer RowIndex,
const Standard_Integer ColIndex) const
{
return ((Standard_Real**)Addr)[RowIndex][ColIndex];
return ((Standard_Real*)Addr)[(UppC - LowC + 1) * (RowIndex - LowR) + (ColIndex - LowC)];
}
inline void math_DoubleTab::Copy(math_DoubleTab& Other)const
{
memmove((void*)(& Other.Value(Other.LowR,Other.LowC)),
(void*) (& Value(LowR,LowC)),
(int)((UppR - LowR + 1) * (UppC - LowC + 1) * sizeof(Standard_Real)));
memmove (Other.Addr, Addr, (int)((UppR - LowR + 1) * (UppC - LowC + 1) * sizeof(Standard_Real)));
}