Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Gauthier Quesnel
irritator
Commits
7f9b6e47
Commit
7f9b6e47
authored
Apr 21, 2021
by
Gauthier Quesnel
Browse files
gui: show memory usage of external sources
parent
0264d282
Pipeline
#31221
passed with stage
in 1 minute and 41 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
app/gui/sources.cpp
View file @
7f9b6e47
...
...
@@ -536,6 +536,25 @@ show_random()
}
}
static
void
size_in_bytes
(
const
sources
&
src
)
noexcept
{
constexpr
sz
K
=
1024u
;
constexpr
sz
M
=
K
*
1024u
;
constexpr
sz
G
=
M
*
1024u
;
const
sz
c
=
src
.
csts
.
size
()
*
sizeof
(
irt
::
source
::
constant
)
+
src
.
bins
.
size
()
*
sizeof
(
irt
::
source
::
binary_file
)
+
src
.
texts
.
size
()
*
sizeof
(
irt
::
source
::
text_file
);
if
(
c
/
G
>
0
)
ImGui
::
Text
(
"Memory usage: %f Gb"
,
((
double
)
c
/
(
double
)
G
));
else
if
(
c
/
M
>
0
)
ImGui
::
Text
(
"Memory usage: %f Mb"
,
((
double
)
c
/
(
double
)
M
));
else
ImGui
::
Text
(
"Memory usage: %f Kb"
,
((
double
)
c
/
(
double
)
K
));
}
void
sources
::
show
(
bool
*
is_show
)
{
...
...
@@ -738,6 +757,8 @@ sources::show(bool* is_show)
}
}
size_in_bytes
(
*
this
);
ImGui
::
End
();
}
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment