Merge lp:~percona-dev/percona-patches/5.0.84-fix-bug-407117 into lp:~percona-dev/percona-patches/5.0.84

Proposed by Yasufumi Kinoshita
Status: Merged
Merge reported by: Yasufumi Kinoshita
Merged at revision: not available
Proposed branch: lp:~percona-dev/percona-patches/5.0.84-fix-bug-407117
Merge into: lp:~percona-dev/percona-patches/5.0.84
Diff against target: None lines
To merge this branch: bzr merge lp:~percona-dev/percona-patches/5.0.84-fix-bug-407117
Reviewer Review Type Date Requested Status
Vadim Tkachenko Approve
Review via email: mp+9574@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Vadim Tkachenko (vadim-tk) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'innodb_use_sys_malloc.patch'
2--- innodb_use_sys_malloc.patch 2009-07-06 08:27:42 +0000
3+++ innodb_use_sys_malloc.patch 2009-08-03 06:43:35 +0000
4@@ -9,6 +9,23 @@
5 extern ibool srv_thread_concurrency_timer_based;
6
7 extern ulint srv_n_file_io_threads;
8+diff -ruN a/innobase/include/ut0mem.h b/innobase/include/ut0mem.h
9+--- a/innobase/include/ut0mem.h 2009-07-07 21:54:07.000000000 +0900
10++++ b/innobase/include/ut0mem.h 2009-08-03 14:42:17.000000000 +0900
11+@@ -30,6 +30,13 @@
12+
13+
14+ /**************************************************************************
15++Initializes the mem block list at database startup. */
16++
17++void
18++ut_mem_block_list_init(void);
19++/*========================*/
20++
21++/**************************************************************************
22+ Allocates memory. Sets it also to zero if UNIV_SET_MEM_TO_ZERO is
23+ defined and set_to_zero is TRUE. */
24+
25 diff -ruN a/innobase/mem/mem0dbg.c b/innobase/mem/mem0dbg.c
26 --- a/innobase/mem/mem0dbg.c 2009-05-08 06:12:10.000000000 +0900
27 +++ b/innobase/mem/mem0dbg.c 2009-07-06 16:48:17.000000000 +0900
28@@ -81,6 +98,14 @@
29 ibool srv_thread_concurrency_timer_based = TRUE;
30 ulong srv_thread_concurrency = 0;
31 ulong srv_commit_concurrency = 0;
32+@@ -1012,6 +1013,7 @@
33+ srv_general_init(void)
34+ /*==================*/
35+ {
36++ ut_mem_block_list_init();
37+ os_sync_init();
38+ sync_init();
39+ mem_init(srv_mem_pool_size);
40 diff -ruN a/innobase/srv/srv0start.c b/innobase/srv/srv0start.c
41 --- a/innobase/srv/srv0start.c 2009-07-06 15:59:52.000000000 +0900
42 +++ b/innobase/srv/srv0start.c 2009-07-06 16:23:38.000000000 +0900
43@@ -107,25 +132,40 @@
44
45 /* This struct is placed first in every allocated memory block */
46 typedef struct ut_mem_block_struct ut_mem_block_t;
47-@@ -70,6 +71,18 @@
48+@@ -43,7 +44,7 @@
49+
50+ /**************************************************************************
51+ Initializes the mem block list at database startup. */
52+-static
53++
54+ void
55+ ut_mem_block_list_init(void)
56+ /*========================*/
57+@@ -70,11 +71,21 @@
58 ulint retry_count = 0;
59 void* ret;
60
61+- ut_ad((sizeof(ut_mem_block_t) % 8) == 0); /* check alignment ok */
62 + if (UNIV_LIKELY(srv_use_sys_malloc)) {
63 + ret = malloc(n);
64 + ut_a(ret || !assert_on_error);
65-+
66+
67+- if (!ut_mem_block_list_inited) {
68+- ut_mem_block_list_init();
69 +#ifdef UNIV_SET_MEM_TO_ZERO
70 + if (set_to_zero) {
71 + memset(ret, '\0', n);
72 + }
73 +#endif
74 + return(ret);
75-+ }
76-+
77- ut_ad((sizeof(ut_mem_block_t) % 8) == 0); /* check alignment ok */
78+ }
79++
80++ ut_ad((sizeof(ut_mem_block_t) % 8) == 0); /* check alignment ok */
81++
82++ ut_a(ut_mem_block_list_inited);
83+ retry:
84+ os_fast_mutex_lock(&ut_list_mutex);
85
86- if (!ut_mem_block_list_inited) {
87 @@ -223,6 +236,11 @@
88 {
89 ut_mem_block_t* block;

Subscribers

People subscribed via source and target branches

to all changes: