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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
0d5f0ab7
Commit
0d5f0ab7
authored
Dec 07, 2006
by
marko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
branches/zip: buf_buddy_alloc_free(), buf_buddy_alloc_free_low():
Add parameter "split" for enabling splits.
parent
2a25f556
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
5 deletions
+21
-5
buf/buf0buddy.c
buf/buf0buddy.c
+11
-1
include/buf0buddy.h
include/buf0buddy.h
+3
-1
include/buf0buddy.ic
include/buf0buddy.ic
+7
-3
No files found.
buf/buf0buddy.c
View file @
0d5f0ab7
...
@@ -22,7 +22,9 @@ buf_buddy_alloc_free_low(
...
@@ -22,7 +22,9 @@ buf_buddy_alloc_free_low(
/*=====================*/
/*=====================*/
/* out: allocated block, or NULL
/* out: allocated block, or NULL
if buf_pool->zip_free[] was empty */
if buf_pool->zip_free[] was empty */
ulint
i
)
/* in: index of buf_pool->zip_free[] */
ulint
i
,
/* in: index of buf_pool->zip_free[] */
ibool
split
)
/* in: TRUE=attempt splitting,
FALSE=try to allocate exact size */
{
{
buf_page_t
*
bpage
;
buf_page_t
*
bpage
;
...
@@ -37,6 +39,14 @@ buf_buddy_alloc_free_low(
...
@@ -37,6 +39,14 @@ buf_buddy_alloc_free_low(
ut_a
(
buf_page_get_state
(
bpage
)
==
BUF_BLOCK_ZIP_FREE
);
ut_a
(
buf_page_get_state
(
bpage
)
==
BUF_BLOCK_ZIP_FREE
);
UT_LIST_REMOVE
(
list
,
buf_pool
->
zip_free
[
i
],
bpage
);
UT_LIST_REMOVE
(
list
,
buf_pool
->
zip_free
[
i
],
bpage
);
}
else
if
(
split
&&
i
+
1
<
BUF_BUDDY_SIZES
)
{
bpage
=
buf_buddy_alloc_free_low
(
i
+
1
,
split
);
if
(
bpage
)
{
buf_page_t
*
buddy
=
bpage
+
BUF_BUDDY_LOW
<<
i
;
UT_LIST_ADD_FIRST
(
list
,
buf_pool
->
zip_free
[
i
],
buddy
);
}
}
}
return
(
bpage
);
return
(
bpage
);
...
...
include/buf0buddy.h
View file @
0d5f0ab7
...
@@ -47,7 +47,9 @@ UNIV_INLINE
...
@@ -47,7 +47,9 @@ UNIV_INLINE
void
*
void
*
buf_buddy_alloc_free
(
buf_buddy_alloc_free
(
/*=================*/
/*=================*/
ulint
size
)
/* in: block size, up to UNIV_PAGE_SIZE / 2 */
ulint
size
,
/* in: block size, up to UNIV_PAGE_SIZE / 2 */
ibool
split
)
/* in: TRUE=attempt splitting,
FALSE=try to allocate exact size */
__attribute__
((
malloc
));
__attribute__
((
malloc
));
#ifndef UNIV_NONINL
#ifndef UNIV_NONINL
...
...
include/buf0buddy.ic
View file @
0d5f0ab7
...
@@ -22,7 +22,9 @@ buf_buddy_alloc_free_low(
...
@@ -22,7 +22,9 @@ buf_buddy_alloc_free_low(
/*=====================*/
/*=====================*/
/* out: allocated block, or NULL
/* out: allocated block, or NULL
if buf_pool->zip_free[] was empty */
if buf_pool->zip_free[] was empty */
ulint i) /* in: index of buf_pool->zip_free[] */
ulint i, /* in: index of buf_pool->zip_free[] */
ibool split) /* in: TRUE=attempt splitting,
FALSE=try to allocate exact size */
__attribute__((malloc));
__attribute__((malloc));
/**************************************************************************
/**************************************************************************
...
@@ -70,13 +72,15 @@ UNIV_INLINE
...
@@ -70,13 +72,15 @@ UNIV_INLINE
void*
void*
buf_buddy_alloc_free(
buf_buddy_alloc_free(
/*=================*/
/*=================*/
ulint size) /* in: block size, up to UNIV_PAGE_SIZE / 2 */
ulint size, /* in: block size, up to UNIV_PAGE_SIZE / 2 */
ibool split) /* in: TRUE=attempt splitting,
FALSE=try to allocate exact size */
{
{
#ifdef UNIV_SYNC_DEBUG
#ifdef UNIV_SYNC_DEBUG
ut_a(mutex_own(&buf_pool->mutex));
ut_a(mutex_own(&buf_pool->mutex));
#endif /* UNIV_SYNC_DEBUG */
#endif /* UNIV_SYNC_DEBUG */
return(buf_buddy_alloc_free_low(buf_buddy_get_slot(size)));
return(buf_buddy_alloc_free_low(buf_buddy_get_slot(size)
, split
));
}
}
#ifdef UNIV_MATERIALIZE
#ifdef UNIV_MATERIALIZE
...
...
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