Merge lp:~akopytov/percona-server/bug1189743-5.6 into lp:percona-server/5.6

Proposed by Alexey Kopytov
Status: Merged
Approved by: Laurynas Biveinis
Approved revision: no longer in the source branch.
Merged at revision: 403
Proposed branch: lp:~akopytov/percona-server/bug1189743-5.6
Merge into: lp:percona-server/5.6
Diff against target: 94 lines (+2/-53)
3 files modified
Percona-Server/storage/innobase/include/ut0mem.h (+0/-16)
Percona-Server/storage/innobase/trx/trx0trx.cc (+2/-2)
Percona-Server/storage/innobase/ut/ut0mem.cc (+0/-35)
To merge this branch: bzr merge lp:~akopytov/percona-server/bug1189743-5.6
Reviewer Review Type Date Requested Status
Laurynas Biveinis (community) Approve
Registry Administrators Pending
Review via email: mp+172472@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Laurynas Biveinis (laurynas-biveinis) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Percona-Server/storage/innobase/include/ut0mem.h'
2--- Percona-Server/storage/innobase/include/ut0mem.h 2013-05-31 09:12:04 +0000
3+++ Percona-Server/storage/innobase/include/ut0mem.h 2013-07-02 07:12:38 +0000
4@@ -92,22 +92,6 @@
5 Allocates memory. */
6 #define ut_malloc(n) ut_malloc_low(n, TRUE)
7 /**********************************************************************//**
8-Allocates cleared memory, provides calloc()-like interface.
9-@return own: allocated memory */
10-UNIV_INTERN
11-void*
12-ut_calloc_low(
13-/*==========*/
14- ulint n, /*!< in: number of elements */
15- ulint c, /*!< in: size of an element */
16- ibool assert_on_error) /*!< in: if TRUE, we crash mysqld if
17- the memory cannot be allocated */
18- __attribute__((malloc));
19-/**********************************************************************//**
20-Allocates cleared memory, provides calloc()-like interface.
21-@return own: allocated memory */
22-#define ut_calloc(n, c) ut_calloc_low(n, c, TRUE)
23-/**********************************************************************//**
24 Frees a memory block allocated with ut_malloc. Freeing a NULL pointer is
25 a nop. */
26 UNIV_INTERN
27
28=== modified file 'Percona-Server/storage/innobase/trx/trx0trx.cc'
29--- Percona-Server/storage/innobase/trx/trx0trx.cc 2013-06-25 13:13:06 +0000
30+++ Percona-Server/storage/innobase/trx/trx0trx.cc 2013-07-02 07:12:38 +0000
31@@ -225,7 +225,7 @@
32 mem_heap_t* heap;
33 ib_alloc_t* heap_alloc;
34
35- trx = static_cast<trx_t*>(ut_calloc(1, sizeof(*trx)));
36+ trx = static_cast<trx_t*>(mem_zalloc(sizeof(*trx)));
37
38 mutex_create(trx_mutex_key, &trx->mutex, SYNC_TRX);
39
40@@ -381,7 +381,7 @@
41
42 read_view_free(trx->prebuilt_view);
43
44- ut_free(trx);
45+ mem_free(trx);
46 }
47
48 /********************************************************************//**
49
50=== modified file 'Percona-Server/storage/innobase/ut/ut0mem.cc'
51--- Percona-Server/storage/innobase/ut/ut0mem.cc 2013-05-31 09:12:04 +0000
52+++ Percona-Server/storage/innobase/ut/ut0mem.cc 2013-07-02 07:12:38 +0000
53@@ -206,41 +206,6 @@
54 }
55
56 /**********************************************************************//**
57-Allocates cleared memory, provides calloc()-like interface.
58-@return own: allocated memory */
59-UNIV_INTERN
60-void*
61-ut_calloc_low(
62-/*==========*/
63- ulint n, /*!< in: number of elements */
64- ulint c, /*!< in: size of an element */
65- ibool assert_on_error) /*!< in: if TRUE, we crash mysqld if
66- the memory cannot be allocated */
67-{
68- void* ret;
69-
70- if (UNIV_LIKELY(srv_use_sys_malloc)) {
71-
72- ret = calloc(n, c);
73- ut_a(ret || !assert_on_error);
74-
75- return ret;
76- }
77-
78- ret = ut_malloc(n * c);
79-
80- if (UNIV_LIKELY(ret != NULL)) {
81-
82- memset(ret, 0, n * c);
83- } else {
84-
85- ut_a(!assert_on_error);
86- }
87-
88- return ret;
89-}
90-
91-/**********************************************************************//**
92 Frees a memory block allocated with ut_malloc. Freeing a NULL pointer is
93 a nop. */
94 UNIV_INTERN

Subscribers

People subscribed via source and target branches