View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0003643VTK(No Category)public2006-08-21 02:342006-09-17 07:57
Reporterwenwu yang 
Assigned ToMathieu Malaterre 
PrioritylowSeverityminorReproducibilityalways
StatusclosedResolutionno change required 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0003643: an error in function "void* vtkHeap::AllocateMemory(size_t n)"
DescriptionIn this function, there are the following codes:

#...

if ( ! this->Current || (this->Position + n) >= this->Current->Size )
    {
    this->Add(blockSize);
    }

#...

I think "(this->Position + n) >= this->Current->Size )" should be replaced by "(this->Position + n) > this->Current->Size )".

For example, there is a block with "pos=0, size=5", which can satisfy quest of n<=5 but not n<=4.
TagsNo tags attached.
Project
Type
Attached Files

 Relationships

  Notes
(0004944)

2006-09-17 07:55

I believe the >= is correct. If pos=0 and n=4 and size=4 then yes we need to reallocate. Because size=4 means we satisfy only n= 0,1,2,3

Closing the bug. Only reopen if you can reproduce in a small test.
(0004945)
Mathieu Malaterre (developer)
2006-09-17 07:57

I believe the code is correct. Ex: pos=0, n=5 and size=5. Then in this case we need to reallocate, because size=5 means we can only satisfy n= 0,1,2,3,4 but not n=5

Closing bug, reopen if you have an example which exhibit the issue.

 Issue History
Date Modified Username Field Change
2011-06-16 13:11 Zack Galbreath Category => (No Category)


Copyright © 2000 - 2018 MantisBT Team