MantisBT
Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Related Changesets ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0023569Community[OCCT] OCCT:Foundation Classespublic2012-11-22 10:362013-04-29 15:21
ReporterRoman Lygin 
Assigned ToRoman Lygin 
PrioritynormalSeverityfeature 
StatusclosedResolutionfixed 
PlatformAOSLOS VersionL
Product Version[OCCT] 6.5.4 
Target Version[OCCT] 6.6.0Fixed in Version[OCCT] 6.6.0 
Summary0023569: Adding NCollection_StdAllocator
DescriptionNCollection_StdAllocator is a C++ standard compliant allocator that wraps Open CASCADE's NCollection_BaseAllocator and its subclasses.

The allocator can be used with standard containers (std::vector, std::map, boost::unordered_set, etc) to take advantage, for instance, of NCollection_IncAllocator (which implements pool allocator) or just central OCC memory allocator interface (Standard::Allocate(), ::Free()) via NCollection_BaseAllocator.

More details will be provided in a dedicated blog post.
Steps To ReproduceSee enclosed test case.
TagsNo tags attached.
Test case numberbug fclasses(002) bug23569_1, bug23569_2
Attached Fileszip file icon NCollection_StdAllocator_Test.zip (717 bytes) 2012-11-22 10:36

- Relationships
parent of 0023726closedkgv Open CASCADE Wrong usage of NCollection_StdAllocator<void> in QANColStdAllocator2 

-  Notes
(0022343)
Roman Lygin (developer)
2012-11-22 10:52

Pushed into git repository as branch CR23569
(0022346)
abv (manager)
2012-11-22 11:16

No remarks; please create test case using attached QtTest-based sample, and test
(0022347)
Roman Lygin (developer)
2012-11-22 11:29

Blog post - http://opencascade.blogspot.com/2012/11/standard-allocator-part-2.html [^]
(0022353)
abv (manager)
2012-11-22 13:15

By the way, would not it be convenient to give this allocator some distinct name, more resembling STL conventions than pure OCCT style? just a thought...
(0022355)
Roman Lygin (developer)
2012-11-22 14:26

Hi Andrey,
Any specific examples you have in mind ? I chose NCollection_StdAllocator to reflect its NCollection wrapping nature and 'StdAllocator' to reflect its purpose and sort of proximity to std::allocator.

Anyway, please feel free to rename as you feel appropriate/consistent with any other possible conventions.
(0022358)
kgv (developer)
2012-11-22 15:29

Dear Roman,

could you please re-format the patch according OCCT coding rules (at least 2-spaces indentation)?

>+ //! Returns the largest value for which method allocate might succeed.
>+ size_type max_size() const throw()
>+ {
>+ size_type aMax = static_cast<size_type>( -1 ) / sizeof( value_type );
>+ return (aMax > 0 ? aMax : 1);
>+ }
this code looks confusing taking into account "typedef size_t size_type".
I see this code is like in MSVC STL implementation but probably better to follow gcc developers in this case?
> size_type max_size() const throw() { return size_t(-1) / sizeof(_Tp); }
(0022365)
Roman Lygin (developer)
2012-11-22 19:04

Kirill,
Thanks for a code review. Your comments have been addressed:
- 4 spaces replaced with 2
- in max_size() a check was removed.
Assigned back to Mikhail.
(0022478)
mkv (tester)
2012-11-30 12:42

Dear BugMaster,
Branch CR23569 (and products from GIT master) was compiled on Linux and Windows platforms and tested.

Regressions:
Not detected

Improvements:
Not detected

Testing cases:
bugs fclasses(002) bug23569_1, bug23569_2 - OK.

- Related Changesets
occt: master ed9161a4
Timestamp: 2012-11-30 12:06:46
Author: Roman Lygin
Details ] Diff ]
0023569: Adding NCollection_StdAllocator

Adding NCollection_StdAllocator
Adding NCollection_StdAllocator (correcting previous commit)
- addressed code review comment by kgv with using 2 (vs 4) spaces and amending max_size()

Add new draw-commands
Adding test case for this bug
mod - src/NCollection/FILES Diff ] File ]
add - src/NCollection/NCollection_StdAllocator.hxx Diff ] File ]
mod - src/QANCollection/FILES Diff ] File ]
mod - src/QANCollection/QANCollection.cdl Diff ] File ]
mod - src/QANCollection/QANCollection.cxx Diff ] File ]
add - src/QANCollection/QANCollection4.cxx Diff ] File ]
add - tests/bugs/fclasses/bug23569_1 Diff ] File ]
add - tests/bugs/fclasses/bug23569_2 Diff ] File ]

- Issue History
Date Modified Username Field Change
2012-11-22 10:36 Roman Lygin New Issue
2012-11-22 10:36 Roman Lygin Assigned To => abv
2012-11-22 10:36 Roman Lygin File Added: NCollection_StdAllocator_Test.zip
2012-11-22 10:52 Roman Lygin Note Added: 0022343
2012-11-22 10:52 Roman Lygin Status new => resolved
2012-11-22 11:16 abv Note Added: 0022346
2012-11-22 11:16 abv Assigned To abv => bugmaster
2012-11-22 11:16 abv Status resolved => reviewed
2012-11-22 11:29 Roman Lygin Note Added: 0022347
2012-11-22 13:15 abv Note Added: 0022353
2012-11-22 13:41 mkv Assigned To bugmaster => mkv
2012-11-22 14:26 Roman Lygin Note Added: 0022355
2012-11-22 15:29 kgv Note Added: 0022358
2012-11-22 18:13 kgv Assigned To mkv => Roman Lygin
2012-11-22 18:13 kgv Status reviewed => assigned
2012-11-22 19:04 Roman Lygin Note Added: 0022365
2012-11-22 19:04 Roman Lygin Assigned To Roman Lygin => mkv
2012-11-22 19:04 Roman Lygin Status assigned => resolved
2012-11-23 11:58 abv Status resolved => reviewed
2012-11-30 12:42 mkv Note Added: 0022478
2012-11-30 12:44 mkv Test case number => bug fclasses(002) bug23569_1, bug23569_2
2012-11-30 12:44 mkv Assigned To mkv => bugmaster
2012-11-30 12:44 mkv Status reviewed => tested
2012-11-30 13:56 bugmaster Target Version => 6.6.0
2012-12-04 13:21 Roman Lygin Changeset attached => occt master ed9161a4
2012-12-04 13:21 Roman Lygin Assigned To bugmaster => Roman Lygin
2012-12-04 13:21 Roman Lygin Status tested => verified
2012-12-04 13:21 Roman Lygin Resolution open => fixed
2012-12-10 17:16 Roman Lygin Changeset attached => occt master ed9161a4
2013-01-26 22:55 kgv Relationship added parent of 0023726
2013-04-23 13:36 aiv Status verified => closed
2013-04-29 15:21 aiv Fixed in Version => 6.6.0


Copyright © 2000 - 2017 MantisBT Team
Powered by Mantis Bugtracker