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
aa8c8329
Commit
aa8c8329
authored
Oct 25, 2007
by
marko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
branches/zip: buf_pool_init(): Allocate buf_pool with mem_zalloc().
parent
a14eb744
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
28 deletions
+3
-28
buf/buf0buf.c
buf/buf0buf.c
+3
-28
No files found.
buf/buf0buf.c
View file @
aa8c8329
...
@@ -880,7 +880,7 @@ buf_pool_init(void)
...
@@ -880,7 +880,7 @@ buf_pool_init(void)
buf_chunk_t
*
chunk
;
buf_chunk_t
*
chunk
;
ulint
i
;
ulint
i
;
buf_pool
=
mem_alloc
(
sizeof
(
buf_pool_t
));
buf_pool
=
mem_
z
alloc
(
sizeof
(
buf_pool_t
));
/* 1. Initialize general fields
/* 1. Initialize general fields
------------------------------- */
------------------------------- */
...
@@ -909,40 +909,20 @@ buf_pool_init(void)
...
@@ -909,40 +909,20 @@ buf_pool_init(void)
buf_pool
->
page_hash
=
hash_create
(
2
*
buf_pool
->
curr_size
);
buf_pool
->
page_hash
=
hash_create
(
2
*
buf_pool
->
curr_size
);
buf_pool
->
zip_hash
=
hash_create
(
2
*
buf_pool
->
curr_size
);
buf_pool
->
zip_hash
=
hash_create
(
2
*
buf_pool
->
curr_size
);
buf_pool
->
n_pend_reads
=
0
;
buf_pool
->
last_printout_time
=
time
(
NULL
);
buf_pool
->
last_printout_time
=
time
(
NULL
);
buf_pool
->
n_pages_read
=
0
;
buf_pool
->
n_pages_written
=
0
;
buf_pool
->
n_pages_created
=
0
;
buf_pool
->
n_page_gets
=
0
;
buf_pool
->
n_page_gets_old
=
0
;
buf_pool
->
n_pages_read_old
=
0
;
buf_pool
->
n_pages_written_old
=
0
;
buf_pool
->
n_pages_created_old
=
0
;
/* 2. Initialize flushing fields
/* 2. Initialize flushing fields
-------------------------------- */
-------------------------------- */
UT_LIST_INIT
(
buf_pool
->
flush_list
);
for
(
i
=
BUF_FLUSH_LRU
;
i
<
BUF_FLUSH_N_TYPES
;
i
++
)
{
for
(
i
=
BUF_FLUSH_LRU
;
i
<
BUF_FLUSH_N_TYPES
;
i
++
)
{
buf_pool
->
n_flush
[
i
]
=
0
;
buf_pool
->
init_flush
[
i
]
=
FALSE
;
buf_pool
->
no_flush
[
i
]
=
os_event_create
(
NULL
);
buf_pool
->
no_flush
[
i
]
=
os_event_create
(
NULL
);
}
}
buf_pool
->
LRU_flush_ended
=
0
;
buf_pool
->
ulint_clock
=
1
;
buf_pool
->
ulint_clock
=
1
;
buf_pool
->
freed_page_clock
=
0
;
/* 3. Initialize LRU fields
/* 3. Initialize LRU fields
--------------------------- */
--------------------------- */
UT_LIST_INIT
(
buf_pool
->
LRU
);
/* All fields are initialized by mem_zalloc(). */
buf_pool
->
LRU_old
=
NULL
;
mutex_exit
(
&
(
buf_pool
->
mutex
));
mutex_exit
(
&
(
buf_pool
->
mutex
));
...
@@ -950,12 +930,7 @@ buf_pool_init(void)
...
@@ -950,12 +930,7 @@ buf_pool_init(void)
*
UNIV_PAGE_SIZE
/
sizeof
(
void
*
)
/
64
);
*
UNIV_PAGE_SIZE
/
sizeof
(
void
*
)
/
64
);
/* 4. Initialize the buddy allocator fields */
/* 4. Initialize the buddy allocator fields */
/* All fields are initialized by mem_zalloc(). */
UT_LIST_INIT
(
buf_pool
->
zip_clean
);
for
(
i
=
0
;
i
<
BUF_BUDDY_SIZES
;
i
++
)
{
UT_LIST_INIT
(
buf_pool
->
zip_free
[
i
]);
}
return
(
buf_pool
);
return
(
buf_pool
);
}
}
...
...
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