Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
98b79fad
Commit
98b79fad
authored
Dec 10, 2019
by
Mark OLESEN
Browse files
STYLE: avoid potential deadlock when resizing from zero-sized list
- not yet triggered by any code, but avoid anyhow
parent
c2123452
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/OpenFOAM/containers/Lists/List/ListI.H
View file @
98b79fad
...
...
@@ -163,6 +163,8 @@ inline T& Foam::List<T>::newElmt(const label i)
if
(
i
>=
n
)
{
if
(
!
n
)
n
=
1
;
// Avoid dead-lock when starting from zero-sized
do
{
n
*=
2
;
...
...
src/OpenFOAM/db/IOstreams/Tstreams/ITstream.C
View file @
98b79fad
...
...
@@ -114,8 +114,10 @@ void Foam::ITstream::reserveCapacity
label
n
=
tokenList
::
size
();
if
(
nElem
>
=
n
)
if
(
nElem
>
n
)
{
if
(
!
n
)
n
=
1
;
// Avoid dead-lock when starting from zero-sized
do
{
n
*=
2
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment