Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ISC Open Source Projects
BIND
Commits
5dd1beec
Commit
5dd1beec
authored
Aug 14, 2018
by
Mark Andrews
Committed by
Evan Hunt
Aug 14, 2018
Browse files
mempool didn't work for sizes less than sizeof(void*)
parent
dc5b8ec9
Pipeline
#3655
passed with stages
in 16 minutes and 20 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
lib/isc/mem.c
View file @
5dd1beec
...
...
@@ -1841,6 +1841,12 @@ isc__mempool_create(isc_mem_t *mctx0, size_t size, isc_mempool_t **mpctxp) {
mpctx
->
common
.
magic
=
ISCAPI_MPOOL_MAGIC
;
mpctx
->
lock
=
NULL
;
mpctx
->
mctx
=
mctx
;
/*
* Mempools are stored as a linked list of element.
*/
if
(
size
<
sizeof
(
element
))
{
size
=
sizeof
(
element
);
}
mpctx
->
size
=
size
;
mpctx
->
maxalloc
=
UINT_MAX
;
mpctx
->
allocated
=
0
;
...
...
lib/isc/tests/mem_test.c
View file @
5dd1beec
...
...
@@ -137,6 +137,21 @@ ATF_TC_BODY(isc_mem, tc) {
isc_mem_destroy
(
&
localmctx
);
result
=
isc_mem_createx2
(
0
,
0
,
default_memalloc
,
default_memfree
,
NULL
,
&
localmctx
,
ISC_MEMFLAG_FILL
|
ISC_MEMFLAG_INTERNAL
);
ATF_REQUIRE_EQ
(
result
,
ISC_R_SUCCESS
);
result
=
isc_mempool_create
(
localmctx
,
2
,
&
mp1
);
ATF_REQUIRE_EQ
(
result
,
ISC_R_SUCCESS
);
tmp
=
isc_mempool_get
(
mp1
);
ATF_CHECK
(
tmp
!=
NULL
);
isc_mempool_put
(
mp1
,
tmp
);
isc_mempool_destroy
(
&
mp1
);
isc_test_end
();
}
...
...
Mark Andrews
@marka
mentioned in commit
cbccec86
·
Aug 14, 2018
mentioned in commit
cbccec86
mentioned in commit cbccec86f77bf0bd258779fc1703e14e9e058748
Toggle commit list
Mark Andrews
@marka
mentioned in commit
12665132
·
Aug 14, 2018
mentioned in commit
12665132
mentioned in commit 126651321e619828b75c5771b51d5503a1d4a3dd
Toggle commit list
Mark Andrews
@marka
mentioned in commit
a21b1b86
·
Aug 14, 2018
mentioned in commit
a21b1b86
mentioned in commit a21b1b86dc183e31470de96506f29a933813ac16
Toggle commit list
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