Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SWIFTsim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
SWIFT
SWIFTsim
Commits
c4838d9b
Commit
c4838d9b
authored
5 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Applied code formatting tool.
parent
ba842dd6
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/memuse.c
+12
-13
12 additions, 13 deletions
src/memuse.c
with
12 additions
and
13 deletions
src/memuse.c
+
12
−
13
View file @
c4838d9b
...
...
@@ -134,8 +134,8 @@ static void memuse_rnode_dump(int depth, struct memuse_rnode *node, int full) {
/* Value of the full key, to this depth. Assumes full key is a pointer,
* so uncomment when using strings. */
static
union
{
//uint8_t key[MEMUSE_MAXLABLEN];
//char ptr[MEMUSE_MAXLABLEN];
//
uint8_t key[MEMUSE_MAXLABLEN];
//
char ptr[MEMUSE_MAXLABLEN];
uint8_t
key
[
sizeof
(
uintptr_t
)];
void
*
ptr
;
}
keyparts
=
{
0
};
...
...
@@ -143,7 +143,7 @@ static void memuse_rnode_dump(int depth, struct memuse_rnode *node, int full) {
/* Record keypart at this depth. Root has no keypart. */
if
(
depth
!=
0
)
keyparts
.
key
[
depth
-
1
]
=
node
->
keypart
;
//if (node->ptr != NULL || full) {
//
if (node->ptr != NULL || full) {
// keyparts.key[depth] = '\0';
//
// /* Gather children's keys if full. */
...
...
@@ -262,8 +262,8 @@ static struct memuse_rnode *memuse_rnode_lookup(const struct memuse_rnode *node,
/* Locate the key, or where it would be inserted. */
if
(
node
->
count
>
0
)
{
unsigned
int
index
=
memuse_rnode_bsearch
(
keypart
,
node
->
children
,
node
->
count
);
unsigned
int
index
=
memuse_rnode_bsearch
(
keypart
,
node
->
children
,
node
->
count
);
if
(
index
<
node
->
count
&&
keypart
==
node
->
children
[
index
]
->
keypart
)
{
return
node
->
children
[
index
];
}
...
...
@@ -298,7 +298,7 @@ static void memuse_rnode_insert_child(struct memuse_rnode *node, uint8_t depth,
/* Are we at the lowest level yet? */
depth
++
;
if
(
depth
==
keylen
)
{
/* Our destination node. */
/* Our destination node. */
#if SWIFT_DEBUG_CHECKS
if
(
child
->
ptr
!=
NULL
)
...
...
@@ -429,7 +429,7 @@ void memuse_log_dump(const char *filename) {
/* Skip if nothing allocated this step. */
if
(
memuse_log_count
==
memuse_old_count
)
return
;
//ticks tic = getticks();
//
ticks tic = getticks();
/* Create the radix tree. If not already done. */
if
(
memuse_rnode_root_init
)
{
...
...
@@ -522,14 +522,13 @@ void memuse_log_dump(const char *filename) {
if
(
memuse_current
>
memuse_maxmem
)
memuse_maxmem
=
memuse_current
;
/* And output. */
fprintf
(
fd
,
"%lld %d %s %zd %zd
\n
"
,
memuse_log
[
k
].
dtic
,
memuse_log
[
k
].
step
,
memuse_log
[
k
].
label
,
memuse_log
[
k
].
size
,
memuse_current
);
fprintf
(
fd
,
"%lld %d %s %zd %zd
\n
"
,
memuse_log
[
k
].
dtic
,
memuse_log
[
k
].
step
,
memuse_log
[
k
].
label
,
memuse_log
[
k
].
size
,
memuse_current
);
}
#ifdef MEMUSE_RNODE_DUMP
/* Debug dump of tree. */
//memuse_rnode_dump(0, memuse_rnode_root, 0);
/* Debug dump of tree. */
//
memuse_rnode_dump(0, memuse_rnode_root, 0);
#endif
/* Now we find all the still active nodes and gather their sizes against the
...
...
@@ -629,7 +628,7 @@ void memuse_log_dump(const char *filename) {
fflush
(
fd
);
fclose
(
fd
);
//message("took %.3f %s.", clocks_from_ticks(getticks() - tic),
//
message("took %.3f %s.", clocks_from_ticks(getticks() - tic),
// clocks_getunit());
}
...
...
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