Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
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
MariaDB
Commits
77aa9552
Commit
77aa9552
authored
Mar 02, 2014
by
John Esmet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixes #116 Remove the 25% padding from toku_mempool_construct. Clean up
the bndata code that calls toku_mempool_construct.
parent
4a9057e8
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
8 deletions
+6
-8
ft/bndata.cc
ft/bndata.cc
+2
-2
util/mempool.cc
util/mempool.cc
+4
-6
No files found.
ft/bndata.cc
View file @
77aa9552
...
...
@@ -114,8 +114,8 @@ void bn_data::initialize_from_data(uint32_t num_entries, unsigned char *buf, uin
}
KLPAIR
*
XMALLOC_N
(
num_entries
,
array
);
// create array of pointers to leafentries
unsigned
char
*
newmem
=
NULL
;
// add
same wiggle room that toku_mempool_construct would, 25% extra
uint32_t
allocated_bytes
=
data_size
+
data_size
/
4
;
// add
25% extra wiggle room
uint32_t
allocated_bytes
=
data_size
+
(
data_size
/
4
)
;
CAST_FROM_VOIDP
(
newmem
,
toku_xmalloc
(
allocated_bytes
));
unsigned
char
*
curr_src_pos
=
buf
;
unsigned
char
*
curr_dest_pos
=
newmem
;
...
...
util/mempool.cc
View file @
77aa9552
...
...
@@ -130,15 +130,13 @@ void toku_mempool_init(struct mempool *mp, void *base, size_t free_offset, size_
*/
void
toku_mempool_construct
(
struct
mempool
*
mp
,
size_t
data_size
)
{
if
(
data_size
)
{
size_t
mpsize
=
data_size
+
(
data_size
/
4
);
// allow 1/4 room for expansion (would be wasted if read-only)
mp
->
base
=
toku_xmalloc
(
mpsize
);
// allocate buffer for mempool
mp
->
size
=
mpsize
;
mp
->
free_offset
=
0
;
// address of first available memory for new data
mp
->
frag_size
=
0
;
// all allocated space is now in use
mp
->
base
=
toku_xmalloc
(
data_size
);
mp
->
size
=
data_size
;
mp
->
free_offset
=
0
;
mp
->
frag_size
=
0
;
}
else
{
toku_mempool_zero
(
mp
);
// fprintf(stderr, "Empty mempool created (base constructor)\n");
}
}
...
...
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