View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0022816 | Community | OCCT:Foundation Classes | public | 2011-11-28 17:10 | 2012-04-03 19:35 |
Reporter | Assigned To | Roman Lygin | |||
Priority | normal | Severity | major | ||
Status | closed | Resolution | fixed | ||
Platform | A | OS | L | ||
Product Version | 6.5.2 | ||||
Target Version | 6.5.3 | Fixed in Version | 6.5.3 | ||
Summary | 0022816: Enhancement request: new[]/delete[] operators should be redefined to use OCC allocation | ||||
Description | Post from the Forum - http://www.opencascade.org/org/forum/thread_22253/. RLN contribution. "The new[] operator (e.g. used in arrays/vectors) is not redefined in OCC classes and thus does not take advantage of OCC memory allocation mechanism (Standard::Allocate(), Standard::Free()). Instead it defaults to standard new/delete [] operators. Example: TopTools_Array1OfShape anArray (1, 10); will underneath call new TopoDS_Shape[10] which will NOT call Standard::Allocate(). We discussed this issue with ABV a while ago, so maybe there is already a bug registered. In this case, please just post an ID here for future tracking." | ||||
Tags | No tags attached. | ||||
Test case number | Test case is not required | ||||
|
I suggest that along with this correction we pack all OCCT-specific declarations of new / delete into a macro (to be defined in Standard_Macro.hxx) and use it in all relevant classes. |
|
Operators new[]/delete[] redefined in the macro OVERRIDE_MEMORY_OPERATORS (src/Standard/Standard_Macro.hxx) to use OCC allocation. bug fixed in the branch: http://svn/svn/occt/branches/OCC22815 Dear Andrey, Please review. |
|
General comment: Please think of a general policy of naming macros to ensure consistency and easy attribution to Open CASCADE. Often, macros are named with product prefix and underscores, for instance this could be: __OCC_OVERRIDE_MEMORY_OPERATORS |
|
See review remarks in 0022815 |
|
Roman is right, macros used in installed header files should be prefixed by OCC_ to avoid name clashes. But please do not use leading underscores, such names are reserved in C++. |
|
Sure these names are reserved, thanks for commenting. We shall consider giving common prefix to macros in the future; in this particular fix I prefer to stick to using currently adopted pattern. |
|
Dear Andrey, check notes in http://tracker.dev.opencascade.org/view.php?id=22815 |
|
Workbench apn-OCC22815-occt/products was successfully tested in http://tracker.dev.opencascade.org/view.php?id=22815 |
|
Problem was solved by fix for issue 22815 |
Date Modified | Username | Field | Change |
---|---|---|---|
2011-11-28 17:10 |
|
New Issue | |
2011-11-28 17:10 |
|
Assigned To | => abv |
2011-11-30 19:11 |
|
Assigned To | abv => dbv |
2011-11-30 19:11 |
|
Status | new => assigned |
2011-11-30 19:18 |
|
Note Added: 0018678 | |
2011-12-01 11:21 |
|
Description Updated | |
2011-12-01 13:29 |
|
Description Updated | |
2012-01-16 13:43 |
|
Note Added: 0019136 | |
2012-01-16 13:43 |
|
Assigned To | dbv => abv |
2012-01-16 13:43 |
|
Status | assigned => resolved |
2012-01-18 13:00 |
|
Description Updated | |
2012-01-18 14:39 | Roman Lygin | Note Added: 0019170 | |
2012-01-18 19:59 |
|
Note Added: 0019175 | |
2012-01-18 19:59 |
|
Assigned To | abv => dbv |
2012-01-18 19:59 |
|
Status | resolved => assigned |
2012-01-18 20:00 |
|
Relationship added | related to 0022815 |
2012-01-19 20:27 | barbier | Note Added: 0019186 | |
2012-01-19 20:33 |
|
Note Added: 0019187 | |
2012-01-19 20:36 |
|
Relationship added | related to 0022916 |
2012-01-20 11:58 |
|
Note Added: 0019192 | |
2012-01-20 11:58 |
|
Assigned To | dbv => abv |
2012-01-20 11:58 |
|
Status | assigned => resolved |
2012-01-23 09:36 |
|
Status | resolved => reviewed |
2012-02-14 13:06 |
|
Assigned To | abv => apn |
2012-02-24 10:29 | apn | Note Added: 0019771 | |
2012-02-24 10:30 | apn | Assigned To | apn => bugmaster |
2012-02-24 10:30 | apn | Status | reviewed => tested |
2012-02-24 10:31 | apn | Test case number | => Test case is not required |
2012-03-10 13:31 | bugmaster | Note Added: 0019910 | |
2012-03-10 13:31 | bugmaster | Status | tested => verified |
2012-03-10 13:31 | bugmaster | Resolution | open => fixed |
2012-03-10 13:31 | bugmaster | Assigned To | bugmaster => dbv |
2012-04-03 19:35 |
|
Assigned To | dbv => Roman Lygin |