Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
labs
BIRD Internet Routing Daemon
Commits
92af6f30
Commit
92af6f30
authored
Oct 29, 1999
by
Martin Mareš
Browse files
Simplify handling of free chunks.
parent
54165b13
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/mempool.c
View file @
92af6f30
...
...
@@ -73,9 +73,12 @@ lp_alloc(linpool *m, unsigned size)
}
else
{
if
(
m
->
current
&&
m
->
current
->
next
)
/* Still have free chunks from previous incarnation (before lp_flush()) */
c
=
m
->
current
->
next
;
if
(
m
->
current
)
{
/* Still have free chunks from previous incarnation (before lp_flush()) */
c
=
m
->
current
;
m
->
current
=
c
->
next
;
}
else
{
/* Need to allocate a new chunk */
...
...
@@ -85,7 +88,6 @@ lp_alloc(linpool *m, unsigned size)
m
->
plast
=
&
c
->
next
;
c
->
next
=
NULL
;
}
m
->
current
=
c
;
m
->
ptr
=
c
->
data
+
size
;
m
->
end
=
c
->
data
+
m
->
chunk_size
;
}
...
...
Write
Preview
Supports
Markdown
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