View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0013261 | Open CASCADE | OCCT:Foundation Classes | public | 2006-08-23 12:30 | 2012-10-25 12:57 |
Reporter | Assigned To | ||||
Priority | normal | Severity | trivial | ||
Status | closed | Resolution | no change required | ||
OS | All | ||||
Summary | 0013261: Ensure correct allocation/deallocation of memory blocks of size 0 | ||||
Description | According to C++ standard (ISO/IEC 14882, 3.7.3.1, clause 2), allocator functions in C++ must allow allocation (and, respectively, deallocation) of blocks of zero size, resulting in non-zero pointer. Current implementation of OCC optimized memory manager (class Standard_MMgrOpt) does not satisfy this requirement: though the allocation request for zero-sized block will be correctly processed and give non-zero pointer, on freeing this block the zero value stored in the beginning of it will be misinterpreted as if the block was allocated as 'big' one. Note that if we allow blocks of zero size, we must reserve space for them in the free list. Alternatively, we may extend size of such blocks to 16 bytes... Fixing this bug can be combined with IMP OCC13258 (see relevant comment to that bug) P.S. Note that this bug has not been checked in practice, thus it is possible (though unlikely) that I am wrong... | ||||
Tags | No tags attached. | ||||
Test case number | |||||
related to | 0023033 | closed | Open CASCADE | Standard_MMgrOpt::Reallocate behavior must be similar to "realloc" |
|
Dear Andrey, Current implementation of OCC optimized memory manager satisfies the requirements specified in the description, so the bug can be closed. |
|
Allocation and deallocation of small and medium blocks works correctly. If we request to allocate block of zero size, then free it, in myFreeList adding pointer to this zero-block on zero index. It is correct, because minimum index of myFreeList is 0 and maximum index is myFreeListMax. Count of memory for myFreeList equal (myFreeListMax+1). myFreeList = (Standard_Size **) calloc (myFreeListMax+1, sizeof(Standard_Size *)); |
Date Modified | Username | Field | Change |
---|---|---|---|
2006-10-12 12:44 | bugmaster | Assigned To | bugmaster => agv |
2006-10-12 12:44 | bugmaster | Status | new => assigned |
2007-02-04 18:25 |
|
OtherBugsDependingOnThis | => 10096 |
2011-08-02 11:23 | bugmaster | Category | OCCT:FDC => OCCT:Foundation Classes |
2012-03-21 14:43 |
|
Assigned To | agv => dbv |
2012-03-21 14:44 |
|
Relationship added | related to 0023033 |
2012-03-30 11:08 |
|
Note Added: 0020219 | |
2012-03-30 11:08 |
|
Assigned To | dbv => abv |
2012-03-30 11:08 |
|
Status | assigned => resolved |
2012-10-03 08:29 |
|
Assigned To | abv => ilv |
2012-10-24 17:17 |
|
Fixed in Version | EMPTY => |
2012-10-24 17:17 |
|
Target Version | => 6.6.0 |
2012-10-24 17:17 |
|
Description Updated | |
2012-10-25 12:25 |
|
Note Added: 0021938 | |
2012-10-25 12:57 |
|
Status | resolved => closed |
2012-10-25 12:57 |
|
Resolution | open => no change required |
2012-10-25 12:57 |
|
Target Version | 6.6.0 => |