Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
5f0a92e5
Commit
5f0a92e5
authored
9 years ago
by
Arnaud Charlet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix typos.
From-SVN: r229054
parent
319c6161
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
31 deletions
+30
-31
gcc/ada/g-debpoo.adb
+21
-22
gcc/ada/g-debpoo.ads
+9
-9
No files found.
gcc/ada/g-debpoo.adb
View file @
5f0a92e5
...
...
@@ -91,14 +91,14 @@ package body GNAT.Debug_Pools is
Disable
:
Boolean
:=
False
;
--
This
variable
is
used
to
avoid
infinite
loops
,
where
this
package
would
--
itself
allocate
memory
and
then
call
s
itself
recursively
,
forever
.
--
Useful
when
System_Memory_Debug_Pool_Enabled
is
True
.
--
itself
allocate
memory
and
then
call
itself
recursively
,
forever
.
Useful
--
when
System_Memory_Debug_Pool_Enabled
is
True
.
System_Memory_Debug_Pool_Enabled
:
Boolean
:=
False
;
--
If
True
System
.
Memory
allocation
are
using
Debug_Pool
--
If
True
,
System
.
Memory
allocation
uses
Debug_Pool
Allow_Unhandled_Memory
:
Boolean
:=
False
;
--
If
True
protects
Deallocate
against
releasing
memory
allocated
before
--
If
True
,
protects
Deallocate
against
releasing
memory
allocated
before
--
System_Memory_Debug_Pool_Enabled
was
set
.
---------------------------
...
...
@@ -131,19 +131,18 @@ package body GNAT.Debug_Pools is
Traceback
:
Tracebacks_Array_Access
;
Kind
:
Traceback_Kind
;
Count
:
Natural
;
--
size
of
the
memory
allocated
/
freed
at
Traceback
since
last
Reset
--
call
.
--
Size
of
the
memory
allocated
/
freed
at
Traceback
since
last
Reset
call
Total
:
Byte_Count
;
--
n
umber
of
chunk
of
memory
allocated
/
freed
at
Traceback
since
last
--
N
umber
of
chunk
of
memory
allocated
/
freed
at
Traceback
since
last
--
Reset
call
.
Frees
:
Natural
;
--
n
umber
of
chunk
of
memory
allocated
at
Traceback
,
currently
freed
--
N
umber
of
chunk
of
memory
allocated
at
Traceback
,
currently
freed
--
since
last
Reset
call
.
(
only
for
Alloc
&
Indirect_Alloc
elements
)
Total_Frees
:
Byte_Count
;
--
s
ize
of
the
memory
allocated
at
Traceback
,
currently
freed
since
last
--
S
ize
of
the
memory
allocated
at
Traceback
,
currently
freed
since
last
--
Reset
call
.
(
only
for
Alloc
&
Indirect_Alloc
elements
)
Next
:
Traceback_Htable_Elem_Ptr
;
...
...
@@ -296,19 +295,19 @@ package body GNAT.Debug_Pools is
-- Ignored_Frame_Start .. Ignored_Frame_End
procedure Stdout_Put (S : String);
-- Wrapper for Put that ensure
we always write to stdout
--
instead of the
current output file defined in GNAT.IO.
-- Wrapper for Put that ensure
s we always write to stdout instead of the
-- current output file defined in GNAT.IO.
procedure Stdout_Put_Line (S : String);
-- Wrapper for Put_Line that ensure
we always write to stdout
--
instead of
the current output file defined in GNAT.IO.
-- Wrapper for Put_Line that ensure
s we always write to stdout instead of
-- the current output file defined in GNAT.IO.
package Validity is
function Is_Handled (Storage : System.Address) return Boolean;
pragma Inline (Is_Handled);
-- Return True if Storage is the address of a block that the debug pool
--
had already under its control.
--
Used to allow System.Memory to use
Debug_Pools
--
already had under its control. Used to allow System.Memory to use
-- Debug_Pools
function Is_Valid (Storage : System.Address) return Boolean;
pragma Inline (Is_Valid);
...
...
@@ -635,13 +634,13 @@ package body GNAT.Debug_Pools is
type Validity_Bits is record
Valid : Validity_Bits_Part_Ref := No_Validity_Bits_Part;
-- True if chunk of memory at this address
currently allocated.
-- True if chunk of memory at this address
is currently allocated
Handled : Validity_Bits_Part_Ref := No_Validity_Bits_Part;
-- True if chunk of memory at this address was allocated once after
-- Allow_Unhandled_Memory was set to True.
--
Used to know on Deallocate if chunk of memory should be handled
--
as a block allocated by this
package.
-- Allow_Unhandled_Memory was set to True.
Used to know on Deallocate
--
if chunk of memory should be handled a block allocated by this
-- package.
end record;
...
...
@@ -658,7 +657,7 @@ package body GNAT.Debug_Pools is
(Storage : System.Address;
Valid : Boolean) return Boolean;
pragma Inline (Is_Valid_Or_Handled);
--
i
nternal implementation of Is_Valid and Is_Handled.
--
I
nternal implementation of Is_Valid and Is_Handled.
-- Valid is used to select Valid or Handled arrays.
package Validy_Htable is new GNAT.HTable.Simple_HTable
...
...
@@ -669,7 +668,7 @@ package body GNAT.Debug_Pools is
Hash => Hash,
Equal => "=");
-- Table to keep the validity and handled bit blocks for the allocated
-- data
-- data
.
function To_Pointer is new Ada.Unchecked_Conversion
(System.Address, Validity_Bits_Part_Ref);
...
...
@@ -1850,7 +1849,7 @@ package body GNAT.Debug_Pools is
--
Handle
only
alloc
elememts
if
Elem
.
Kind
=
Alloc
then
--
Ignore
small
blocks
(
depending
on
the
sorting
criteria
)
to
--
gain
speed
--
gain
speed
.
if
(
Sort
=
Memory_Usage
and
then
Elem
.
Total
-
Elem
.
Total_Frees
>=
1
_000
)
...
...
This diff is collapsed.
Click to expand it.
gcc/ada/g-debpoo.ads
View file @
5f0a92e5
...
...
@@ -276,7 +276,7 @@ package GNAT.Debug_Pools is
Report
:
Report_Type
:=
All_Reports
);
--
Dump
information
about
memory
usage
.
--
Size
is
the
number
of
the
biggest
memory
users
we
want
to
show
.
Report
--
indicates
which
sorting
order
is
used
in
the
report
--
indicates
which
sorting
order
is
used
in
the
report
.
procedure
Dump_Stdout
(
Pool
:
Debug_Pool
;
...
...
@@ -294,29 +294,29 @@ package GNAT.Debug_Pools is
(
Storage_Address
:
Address
;
Size_In_Storage_Elements
:
out
Storage_Count
;
Valid
:
out
Boolean
);
--
s
et
Valid
if
Storage_Address
is
the
address
of
a
chunk
of
memory
--
S
et
Valid
if
Storage_Address
is
the
address
of
a
chunk
of
memory
--
currently
allocated
by
any
pool
.
--
If
Valid
is
True
,
Size_In_Storage_Elements
is
set
to
the
size
of
this
--
chunk
of
memory
.
type
Byte_Count
is
mod
System
.
Max_Binary_Modulus
;
--
Type
used
for
maintaining
byte
counts
,
needs
to
be
large
enough
--
Type
used
for
maintaining
byte
counts
,
needs
to
be
large
enough
to
--
to
accommodate
counts
allowing
for
repeated
use
of
the
same
memory
.
function
High_Water_Mark
(
Pool
:
Debug_Pool
)
return
Byte_Count
;
--
r
eturn
the
highest
size
of
the
memory
allocated
by
the
pool
.
--
m
emory
used
internally
by
the
pool
is
not
taken
into
account
.
--
R
eturn
the
highest
size
of
the
memory
allocated
by
the
pool
.
--
M
emory
used
internally
by
the
pool
is
not
taken
into
account
.
function
Current_Water_Mark
(
Pool
:
Debug_Pool
)
return
Byte_Count
;
--
r
eturn
the
size
of
the
memory
currently
allocated
by
the
pool
.
--
m
emory
used
internally
by
the
pool
is
not
taken
into
account
.
--
R
eturn
the
size
of
the
memory
currently
allocated
by
the
pool
.
--
M
emory
used
internally
by
the
pool
is
not
taken
into
account
.
procedure
System_Memory_Debug_Pool
(
Has_Unhandled_Memory
:
Boolean
:=
True
);
--
l
et
the
package
know
the
System
.
Memory
is
using
it
.
--
If
Has_Unhandled_Memory
is
true
,
some
deallocat
e
can
be
done
for
--
L
et
the
package
know
the
System
.
Memory
is
using
it
.
--
If
Has_Unhandled_Memory
is
true
,
some
deallocat
ion
can
be
done
for
--
memory
not
allocated
with
Allocate
.
private
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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