Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
libloc
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
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
nexedi
libloc
Commits
635c344a
Commit
635c344a
authored
Mar 09, 2022
by
Michael Tremer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
network-list: Grow just like the AS list
Signed-off-by:
Michael Tremer
<
michael.tremer@ipfire.org
>
parent
233311e8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
src/network-list.c
src/network-list.c
+6
-2
No files found.
src/network-list.c
View file @
635c344a
...
...
@@ -33,7 +33,11 @@ struct loc_network_list {
size_t
size
;
};
static
int
loc_network_list_grow
(
struct
loc_network_list
*
list
,
size_t
size
)
{
static
int
loc_network_list_grow
(
struct
loc_network_list
*
list
)
{
size_t
size
=
list
->
elements_size
*
2
;
if
(
size
<
1024
)
size
=
1024
;
DEBUG
(
list
->
ctx
,
"Growing network list %p by %zu to %zu
\n
"
,
list
,
size
,
list
->
elements_size
+
size
);
...
...
@@ -221,7 +225,7 @@ LOC_EXPORT int loc_network_list_push(struct loc_network_list* list, struct loc_n
// Check if we have space left
if
(
list
->
size
>=
list
->
elements_size
)
{
int
r
=
loc_network_list_grow
(
list
,
64
);
int
r
=
loc_network_list_grow
(
list
);
if
(
r
)
return
r
;
}
...
...
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