View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0023569 | Community | OCCT:Foundation Classes | public | 2012-11-22 10:36 | 2013-04-29 15:21 |
Reporter | Roman Lygin | Assigned To | Roman Lygin | ||
Priority | normal | Severity | feature | ||
Status | closed | Resolution | fixed | ||
Platform | A | OS | L | ||
Product Version | 6.5.4 | ||||
Target Version | 6.6.0 | Fixed in Version | 6.6.0 | ||
Summary | 0023569: Adding NCollection_StdAllocator | ||||
Description | NCollection_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 Reproduce | See enclosed test case. | ||||
Tags | No tags attached. | ||||
Test case number | bug fclasses(002) bug23569_1, bug23569_2 | ||||
|
NCollection_StdAllocator_Test.zip (717 bytes) |
|
Pushed into git repository as branch CR23569 |
|
No remarks; please create test case using attached QtTest-based sample, and test |
|
Blog post - http://opencascade.blogspot.com/2012/11/standard-allocator-part-2.html |
|
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... |
|
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. |
|
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); } |
|
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. |
|
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. |
occt: master ed9161a4 2012-11-30 12:06:46 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 |
Affected Issues 0023569 |
|
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 |
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 |
|
Note Added: 0022346 | |
2012-11-22 11:16 |
|
Assigned To | abv => bugmaster |
2012-11-22 11:16 |
|
Status | resolved => reviewed |
2012-11-22 11:29 | Roman Lygin | Note Added: 0022347 | |
2012-11-22 13:15 |
|
Note Added: 0022353 | |
2012-11-22 13:41 |
|
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 |
|
Status | resolved => reviewed |
2012-11-30 12:42 |
|
Note Added: 0022478 | |
2012-11-30 12:44 |
|
Test case number | => bug fclasses(002) bug23569_1, bug23569_2 |
2012-11-30 12:44 |
|
Assigned To | mkv => bugmaster |
2012-11-30 12:44 |
|
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 |
|
Status | verified => closed |
2013-04-29 15:21 |
|
Fixed in Version | => 6.6.0 |