MantisBT
Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0022816Community[OCCT] OCCT:Foundation Classespublic2011-11-28 17:102012-04-03 19:35
Reporterszy 
Assigned ToRoman Lygin 
PrioritynormalSeveritymajor 
StatusclosedResolutionfixed 
PlatformAOSLOS VersionL
Product Version[OCCT] 6.5.2 
Target Version[OCCT] 6.5.3Fixed in Version[OCCT] 6.5.3 
Summary0022816: Enhancement request: new[]/delete[] operators should be redefined to use OCC allocation
DescriptionPost 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."
TagsNo tags attached.
Test case numberTest case is not required
Attached Files

- Relationships
related to 0022815closedbugmaster Missing delete operator for placement new 
related to 0022916assignedski Use common prefix for macros in OCCT code 

-  Notes
(0018678)
abv (manager)
2011-11-30 19:18

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.
(0019136)
dbv (developer)
2012-01-16 13:43

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.
(0019170)
Roman Lygin (developer)
2012-01-18 14:39

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
(0019175)
abv (manager)
2012-01-18 19:59

See review remarks in 0022815
(0019186)
barbier (developer)
2012-01-19 20:27

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++.
(0019187)
abv (manager)
2012-01-19 20:33

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.
(0019192)
dbv (developer)
2012-01-20 11:58

Dear Andrey,

check notes in http://tracker.dev.opencascade.org/view.php?id=22815 [^]
(0019771)
apn (administrator)
2012-02-24 10:29

Workbench apn-OCC22815-occt/products was successfully tested in http://tracker.dev.opencascade.org/view.php?id=22815 [^]
(0019910)
bugmaster (administrator)
2012-03-10 13:31

Problem was solved by fix for issue 22815

- Issue History
Date Modified Username Field Change
2011-11-28 17:10 szy New Issue
2011-11-28 17:10 szy Assigned To => abv
2011-11-30 19:11 abv Note Added: 0018676
2011-11-30 19:11 abv Assigned To abv => dbv
2011-11-30 19:11 abv Status new => assigned
2011-11-30 19:11 abv Note Deleted: 0018676
2011-11-30 19:18 abv Note Added: 0018678
2011-12-01 11:21 szy Description Updated View Revisions
2011-12-01 13:29 abv Description Updated View Revisions
2012-01-16 13:43 dbv Note Added: 0019136
2012-01-16 13:43 dbv Assigned To dbv => abv
2012-01-16 13:43 dbv Status assigned => resolved
2012-01-18 13:00 atp Description Updated View Revisions
2012-01-18 14:39 Roman Lygin Note Added: 0019170
2012-01-18 19:59 abv Note Added: 0019175
2012-01-18 19:59 abv Assigned To abv => dbv
2012-01-18 19:59 abv Status resolved => assigned
2012-01-18 20:00 abv Relationship added related to 0022815
2012-01-19 20:27 barbier Note Added: 0019186
2012-01-19 20:33 abv Note Added: 0019187
2012-01-19 20:36 abv Relationship added related to 0022916
2012-01-20 11:58 dbv Note Added: 0019192
2012-01-20 11:58 dbv Assigned To dbv => abv
2012-01-20 11:58 dbv Status assigned => resolved
2012-01-23 09:36 abv Status resolved => reviewed
2012-02-14 13:06 mkv 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 abv Assigned To dbv => Roman Lygin


Copyright © 2000 - 2018 MantisBT Team
Powered by Mantis Bugtracker