Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-common
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Timo Koch
dune-common
Commits
05d0a7ab
Commit
05d0a7ab
authored
20 years ago
by
Robert Klöfkorn
Browse files
Options
Downloads
Patches
Plain Diff
minor changes.
[[Imported from SVN: r1764]]
parent
85d729ec
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
grid/alu3dgrid/alumemory.hh
+12
-11
12 additions, 11 deletions
grid/alu3dgrid/alumemory.hh
with
12 additions
and
11 deletions
grid/alu3dgrid/alumemory.hh
+
12
−
11
View file @
05d0a7ab
...
...
@@ -4,16 +4,20 @@
#define __DUNE_ALUMEMORY_HH__
#include
<stack>
#include
"myautoptr.hh"
//! organize the memory management for entitys used by the NeighborIterator
template
<
class
Object
>
class
MemoryProvider
{
std
::
stack
<
Object
*
>
objStack_
;
typedef
MemoryProvider
<
Object
>
MyType
;
public:
typedef
Object
ObjectType
;
//typedef MemoryPointer< ObjectType, MyType > MemoryPointerType;
//!
freeEntity_ = NULL
//!
delete all objects stored in stack
MemoryProvider
()
{};
//! call deleteEntity
...
...
@@ -44,8 +48,7 @@ MemoryProvider<Object>::getNewObjectEntity
{
if
(
objStack_
.
empty
()
)
{
ObjectType
*
obj
=
new
Object
(
grid
,
level
);
return
obj
;
return
(
new
Object
(
grid
,
level
)
);
}
else
{
...
...
@@ -58,14 +61,12 @@ MemoryProvider<Object>::getNewObjectEntity
template
<
class
Object
>
inline
MemoryProvider
<
Object
>::~
MemoryProvider
()
{
/*
while ( !objStack_.empty() )
{
ObjectType * obj = objStack_.top();
objStack_.pop();
if( obj ) delete obj;
}
*/
while
(
!
objStack_
.
empty
()
)
{
ObjectType
*
obj
=
objStack_
.
top
();
objStack_
.
pop
();
if
(
obj
)
delete
obj
;
}
}
template
<
class
Object
>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment