Skip to content

Commit 5754ea2

Browse files
committed
Fixed compiler failures with gcc 7.4.1 and new my_malloc code
1 parent 41cba6c commit 5754ea2

File tree

3 files changed

+16
-12
lines changed

3 files changed

+16
-12
lines changed

storage/innobase/buf/buf0buddy.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,9 +333,9 @@ static buf_buddy_free_t* buf_buddy_alloc_zip(ulint i)
333333

334334
if (buf) {
335335
/* Trash the page other than the BUF_BUDDY_STAMP_NONFREE. */
336-
UNIV_MEM_TRASH((void*) buf, ~i, BUF_BUDDY_STAMP_OFFSET);
336+
UNIV_MEM_TRASH((void*) buf, (int) ~i, BUF_BUDDY_STAMP_OFFSET);
337337
UNIV_MEM_TRASH(BUF_BUDDY_STAMP_OFFSET + 4
338-
+ buf->stamp.bytes, ~i,
338+
+ buf->stamp.bytes, (int) ~i,
339339
(BUF_BUDDY_LOW << i)
340340
- (BUF_BUDDY_STAMP_OFFSET + 4));
341341
ut_ad(mach_read_from_4(buf->stamp.bytes

storage/maria/ha_s3.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ static void update_access_key(MYSQL_THD thd,
9494
if (s3_tmp_access_key[0])
9595
{
9696
s3_access_key= s3_tmp_access_key;
97-
s3_tmp_access_key= my_strdup("*****", MYF(MY_WME));
97+
s3_tmp_access_key= my_strdup(PSI_NOT_INSTRUMENTED, "*****", MYF(MY_WME));
9898
}
9999
}
100100

@@ -108,7 +108,7 @@ static void update_secret_key(MYSQL_THD thd,
108108
if (s3_tmp_secret_key[0])
109109
{
110110
s3_secret_key= s3_tmp_secret_key;
111-
s3_tmp_secret_key= my_strdup("*****", MYF(MY_WME));
111+
s3_tmp_secret_key= my_strdup(PSI_NOT_INSTRUMENTED, "*****", MYF(MY_WME));
112112
}
113113
}
114114

storage/maria/s3_func.c

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,22 +50,24 @@ TYPELIB s3_protocol_typelib= {array_elements(protocol_types)-1,"",
5050

5151
static void *s3_wrap_malloc(size_t size)
5252
{
53-
return my_malloc(size, MYF(MY_WME));
53+
return my_malloc(PSI_NOT_INSTRUMENTED, size, MYF(MY_WME));
5454
}
5555

5656
static void *s3_wrap_calloc(size_t nmemb, size_t size)
5757
{
58-
return my_malloc(nmemb * size, MYF(MY_WME | MY_ZEROFILL));
58+
return my_malloc(PSI_NOT_INSTRUMENTED, nmemb * size,
59+
MYF(MY_WME | MY_ZEROFILL));
5960
}
6061

6162
static void *s3_wrap_realloc(void *ptr, size_t size)
6263
{
63-
return my_realloc(ptr, size, MYF(MY_WME | MY_ALLOW_ZERO_PTR));
64+
return my_realloc(PSI_NOT_INSTRUMENTED, ptr, size,
65+
MYF(MY_WME | MY_ALLOW_ZERO_PTR));
6466
}
6567

6668
static char *s3_wrap_strdup(const char *str)
6769
{
68-
return my_strdup(str, MYF(MY_WME));
70+
return my_strdup(PSI_NOT_INSTRUMENTED, str, MYF(MY_WME));
6971
}
7072

7173
static void s3_wrap_free(void *ptr)
@@ -110,7 +112,7 @@ S3_INFO *s3_info_copy(S3_INFO *old)
110112
/* Copy lengths */
111113
memcpy(&tmp, old, sizeof(tmp));
112114
/* Allocate new buffers */
113-
if (!my_multi_malloc(MY_WME, &to, sizeof(S3_INFO),
115+
if (!my_multi_malloc(PSI_NOT_INSTRUMENTED, MY_WME, &to, sizeof(S3_INFO),
114116
&tmp.access_key.str, old->access_key.length+1,
115117
&tmp.secret_key.str, old->secret_key.length+1,
116118
&tmp.region.str, old->region.length+1,
@@ -379,7 +381,8 @@ int aria_copy_to_s3(ms3_st *s3_client, const char *aws_bucket,
379381
block_size= (block_size/cap.block_size)*cap.block_size;
380382

381383
/* Allocate block for data + flag for compress header */
382-
if (!(alloc_block= (uchar*) my_malloc(block_size+ALIGN_SIZE(1),
384+
if (!(alloc_block= (uchar*) my_malloc(PSI_NOT_INSTRUMENTED,
385+
block_size+ALIGN_SIZE(1),
383386
MYF(MY_WME))))
384387
goto err;
385388
/* Read/write data here, but with prefix space for compression flag */
@@ -871,7 +874,8 @@ my_bool s3_get_object(ms3_st *s3_client, const char *aws_bucket,
871874

872875
length= uint3korr(block->str+1);
873876

874-
if (!(data= (uchar*) my_malloc(length, MYF(MY_WME | MY_THREAD_SPECIFIC))))
877+
if (!(data= (uchar*) my_malloc(PSI_NOT_INSTRUMENTED,
878+
length, MYF(MY_WME | MY_THREAD_SPECIFIC))))
875879
{
876880
s3_free(block);
877881
DBUG_RETURN(TRUE);
@@ -1183,7 +1187,7 @@ static int s3_read_frm_from_disk(const char *filename, uchar **to,
11831187
return(1);
11841188

11851189
file_size= (size_t) my_seek(file, 0L, MY_SEEK_END, MYF(0));
1186-
if (!(alloc_block= my_malloc(file_size, MYF(MY_WME))))
1190+
if (!(alloc_block= my_malloc(PSI_NOT_INSTRUMENTED, file_size, MYF(MY_WME))))
11871191
goto err;
11881192

11891193
if (my_pread(file, alloc_block, file_size, 0, MYF(MY_WME | MY_FNABP)))

0 commit comments

Comments
 (0)