Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-uggrid
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
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
staging
dune-uggrid
Commits
a1bf3861
Commit
a1bf3861
authored
7 years ago
by
Christian Engwer
Browse files
Options
Downloads
Patches
Plain Diff
[heap] rename functions allocating tagged memory to reflect the purpose of temporary memory
parent
8b9c84f6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!94
Feature/enforce dynamic memory allocmodel
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
gm/er.cc
+2
-2
2 additions, 2 deletions
gm/er.cc
low/heaps.cc
+3
-3
3 additions, 3 deletions
low/heaps.cc
low/heaps.h
+6
-9
6 additions, 9 deletions
low/heaps.h
parallel/dddif/lbrcb.cc
+4
-4
4 additions, 4 deletions
parallel/dddif/lbrcb.cc
with
15 additions
and
18 deletions
gm/er.cc
+
2
−
2
View file @
a1bf3861
...
...
@@ -2113,7 +2113,7 @@ INT NS_DIM_PREFIX NEW_Write_RefRules (MULTIGRID *mg, INT RefRuleOffset[], INT Ma
REP_ERR_RETURN
(
1
);
global
.
heap
=
MGHEAP
(
mg
);
if
(
Mark
(
global
.
heap
,
&
BotMarkKey
))
if
(
Mark
TmpMem
(
global
.
heap
,
&
BotMarkKey
))
REP_ERR_RETURN
(
1
);
/* init rule counters (continue with last rule IDs of rm) */
...
...
@@ -2174,7 +2174,7 @@ INT NS_DIM_PREFIX NEW_Write_RefRules (MULTIGRID *mg, INT RefRuleOffset[], INT Ma
Write_RR_Rules
(
global
.
maxrules
,
*
mrule_handle
);
/* free hrules and hrule table */
if
(
Release
(
global
.
heap
,
BotMarkKey
))
if
(
Release
TmpMem
(
global
.
heap
,
BotMarkKey
))
REP_ERR_RETURN
(
1
);
IFDEBUG
(
gm
,
ER_DBG_GENERAL
)
...
...
This diff is collapsed.
Click to expand it.
low/heaps.cc
+
3
−
3
View file @
a1bf3861
...
...
@@ -174,7 +174,7 @@ void *NS_PREFIX GetMem (HEAP *theHeap, MEM n)
/****************************************************************************/
void
*
NS_PREFIX
GetMem
UsingKey
(
HEAP
*
theHeap
,
MEM
n
,
INT
key
)
void
*
NS_PREFIX
Get
Tmp
Mem
(
HEAP
*
theHeap
,
MEM
n
,
INT
key
)
{
if
(
theHeap
->
type
==
SIMPLE_HEAP
)
{
...
...
@@ -259,7 +259,7 @@ INT NS_PREFIX PutFreelistMemory (HEAP *theHeap, void *object, INT size)
*/
/****************************************************************************/
INT
NS_PREFIX
Mark
(
HEAP
*
theHeap
,
INT
*
key
)
INT
NS_PREFIX
Mark
TmpMem
(
HEAP
*
theHeap
,
INT
*
key
)
{
assert
(
theHeap
->
type
==
SIMPLE_HEAP
);
if
(
theHeap
->
type
!=
SIMPLE_HEAP
)
return
(
1
);
...
...
@@ -286,7 +286,7 @@ INT NS_PREFIX Mark (HEAP *theHeap, INT *key)
*/
/****************************************************************************/
INT
NS_PREFIX
Release
(
HEAP
*
theHeap
,
INT
key
)
INT
NS_PREFIX
Release
TmpMem
(
HEAP
*
theHeap
,
INT
key
)
{
if
(
theHeap
->
type
!=
SIMPLE_HEAP
)
return
1
;
...
...
This diff is collapsed.
Click to expand it.
low/heaps.h
+
6
−
9
View file @
a1bf3861
...
...
@@ -79,10 +79,6 @@ enum HeapAllocMode
FROM_BOTTOM
=
2
/**< Allocate from bottom of stack */
}
DUNE_DEPRECATED
;
#define MarkTmpMem(p,kp) Mark(p,kp)
#define GetTmpMem(p,n,k) GetMemUsingKey(p,n,k)
#define ReleaseTmpMem(p,k) Release(p,k)
/****************************************************************************/
/****************************************************************************/
/** @name Defines and macros for the virtual heap management */
...
...
@@ -136,24 +132,25 @@ typedef struct {
/* @{ */
HEAP
*
NewHeap
(
enum
HeapType
type
,
MEM
size
,
void
*
buffer
);
void
DisposeHeap
(
HEAP
*
theHeap
);
void
*
GetMem
(
HEAP
*
theHeap
,
MEM
n
);
void
*
GetMemUsingKey
(
HEAP
*
theHeap
,
MEM
n
,
INT
key
);
void
DisposeMem
(
HEAP
*
theHeap
,
void
*
buffer
);
void
*
GetFreelistMemory
(
HEAP
*
theHeap
,
INT
size
);
INT
PutFreelistMemory
(
HEAP
*
theHeap
,
void
*
object
,
INT
size
);
INT
Mark
(
HEAP
*
theHeap
,
INT
*
key
);
INT
Release
(
HEAP
*
theHeap
,
INT
key
);
INT
MarkTmpMem
(
HEAP
*
theHeap
,
INT
*
key
);
void
*
GetTmpMem
(
HEAP
*
theHeap
,
MEM
n
,
INT
key
);
INT
ReleaseTmpMem
(
HEAP
*
theHeap
,
INT
key
);
inline
INT
DUNE_DEPRECATED_MSG
(
"Mark taking a mode is deprecated"
)
Mark
(
HEAP
*
theHeap
,
INT
mode
,
INT
*
key
)
{
return
Mark
(
theHeap
,
key
);
return
Mark
TmpMem
(
theHeap
,
key
);
}
inline
INT
DUNE_DEPRECATED_MSG
(
"Release taking a mode is deprecated"
)
Release
(
HEAP
*
theHeap
,
INT
mode
,
INT
key
)
{
return
Release
(
theHeap
,
key
);
return
Release
TmpMem
(
theHeap
,
key
);
}
/* @} */
...
...
This diff is collapsed.
Click to expand it.
parallel/dddif/lbrcb.cc
+
4
−
4
View file @
a1bf3861
...
...
@@ -430,13 +430,13 @@ int NS_DIM_PREFIX BalanceGridRCB (MULTIGRID *theMG, int level)
return
(
1
);
}
Mark
(
theHeap
,
&
MarkKey
);
Mark
TmpMem
(
theHeap
,
&
MarkKey
);
lbinfo
=
(
LB_INFO
*
)
GetMem
UsingKey
(
theHeap
,
NT
(
theGrid
)
*
sizeof
(
LB_INFO
),
MarkKey
);
Get
Tmp
Mem
(
theHeap
,
NT
(
theGrid
)
*
sizeof
(
LB_INFO
),
MarkKey
);
if
(
lbinfo
==
NULL
)
{
Release
(
theHeap
,
MarkKey
);
Release
TmpMem
(
theHeap
,
MarkKey
);
UserWrite
(
"ERROR in BalanceGridRCB: could not allocate memory from the MGHeap
\n
"
);
return
(
1
);
}
...
...
@@ -466,7 +466,7 @@ int NS_DIM_PREFIX BalanceGridRCB (MULTIGRID *theMG, int level)
InheritPartition
(
e
);
}
Release
(
theHeap
,
MarkKey
);
Release
TmpMem
(
theHeap
,
MarkKey
);
}
return
0
;
...
...
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