Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-Spgwu-Tiny-Simple
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
CommunityXG
OpenXG-Spgwu-Tiny-Simple
Commits
ac8f3a75
Commit
ac8f3a75
authored
Apr 01, 2019
by
gauthier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PGWC: bug dynamic allocation
parent
b9eec8ac
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
src/pgwc/pgw_paa_dynamic.hpp
src/pgwc/pgw_paa_dynamic.hpp
+5
-3
No files found.
src/pgwc/pgw_paa_dynamic.hpp
View file @
ac8f3a75
...
...
@@ -92,7 +92,9 @@ protected:
std
::
bitset
<
32
>
bs
(
alloc
[
bit_pos32
]);
bs
.
reset
(
word_bit_pos
);
alloc
[
bit_pos32
]
=
bs
.
to_ulong
();
return
true
;
}
return
false
;
}
public:
...
...
@@ -121,7 +123,8 @@ public:
{
int
bit_pos
=
0
;
if
(
alloc_free_bit
(
bit_pos
))
{
allocated
.
s_addr
=
start
.
s_addr
+
htobe32
(
bit_pos
);
allocated
.
s_addr
=
be32toh
(
start
.
s_addr
)
+
bit_pos
;
// overflow
allocated
.
s_addr
=
htobe32
(
allocated
.
s_addr
);
return
true
;
}
allocated
.
s_addr
=
0
;
...
...
@@ -132,8 +135,7 @@ public:
{
if
(
in_pool
(
allocated
))
{
int
bit_pos
=
be32toh
(
allocated
.
s_addr
)
-
be32toh
(
start
.
s_addr
);
free_bit
(
bit_pos
);
return
true
;
return
free_bit
(
bit_pos
);
}
return
false
;
}
...
...
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