-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lima 7.9.4 recipe, VTK 7.1.1 patch against sub-allocation for meshes …
…>= 10 millions of cells.
- Loading branch information
Charles PIGNEROL
committed
Nov 10, 2023
1 parent
d03d4e5
commit 49e4cd7
Showing
3 changed files
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
...ing_supersede/packages/vtk-maillage/vtk-maillage_vtkAbstractArray_SetNumberOfValues.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
diff -Naur VTK-7.1.1.old/Common/Core/vtkAbstractArray.cxx VTK-7.1.1/Common/Core/vtkAbstractArray.cxx | ||
--- VTK-7.1.1.old/Common/Core/vtkAbstractArray.cxx 2023-11-10 08:09:27.968215356 +0100 | ||
+++ VTK-7.1.1/Common/Core/vtkAbstractArray.cxx 2023-11-10 08:20:58.107217364 +0100 | ||
@@ -187,8 +187,17 @@ | ||
//---------------------------------------------------------------------------- | ||
void vtkAbstractArray::SetNumberOfValues(vtkIdType numValues) | ||
{ | ||
- if (this->Resize(std::ceil(numValues / | ||
- static_cast<float>(this->NumberOfComponents)))) | ||
+/* VTK code 7.1.1. | ||
+ * If NumberOfComponents is 1 and numValues is 46640545, then numValues /static_cast<float>(this->NumberOfComponents), | ||
+ * of floating type, will be 46640544 (the floating precision is 7 significant digits, | ||
+ * cf. https://www.h-schmidt .net/FloatConverter/IEEE754.html) | ||
+ * => insufficient memory allocation causing crash and revealed by valgrind | ||
+ * if (this->Resize(std::ceil(numValues / | ||
+ * static_cast<float>(this->NumberOfComponents)))) | ||
+*/ | ||
+// Replacement VTK 8.2.0 code : | ||
+ vtkIdType numTuples = this->NumberOfComponents == 1 ? numValues : (numValues + this->NumberOfComponents - 1) / this->NumberOfComponents; | ||
+ if (this->Resize(numTuples)) | ||
{ | ||
this->MaxId = numValues - 1; | ||
} |