Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitff86eb5

Browse files
committed
Use pgut_malloc() instead of malloc()
1 parenta23386e commitff86eb5

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

‎.gitignore‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,5 @@
4242
/src/streamutil.c
4343
/src/streamutil.h
4444
/src/xlogreader.c
45+
/src/walmethods.c
46+
/src/walmethods.h

‎src/utils/file.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ FILE* fio_open_stream(char const* path, fio_location location)
112112
if (hdr.size>0)
113113
{
114114
Assert(fio_stdin_buffer==NULL);
115-
fio_stdin_buffer=malloc(hdr.size);
115+
fio_stdin_buffer=pgut_malloc(hdr.size);
116116
IO_CHECK(fio_read_all(fio_stdin,fio_stdin_buffer,hdr.size),hdr.size);
117117
f=fmemopen(fio_stdin_buffer,hdr.size,"r");
118118
}
@@ -752,7 +752,7 @@ fio_gzopen(char const* path, char const* mode, int level, fio_location location)
752752
intrc;
753753
if (fio_is_remote(location))
754754
{
755-
fioGZFile*gz= (fioGZFile*)malloc(sizeof(fioGZFile));
755+
fioGZFile*gz= (fioGZFile*)pgut_malloc(sizeof(fioGZFile));
756756
memset(&gz->strm,0,sizeof(gz->strm));
757757
gz->eof=0;
758758
gz->errnum=Z_OK;
@@ -1014,7 +1014,7 @@ static void fio_send_file(int out, char const* path)
10141014
if (fd >=0)
10151015
{
10161016
off_tsize=lseek(fd,0,SEEK_END);
1017-
buf=malloc(size);
1017+
buf=pgut_malloc(size);
10181018
lseek(fd,0,SEEK_SET);
10191019
IO_CHECK(fio_read_all(fd,buf,size),size);
10201020
hdr.size=size;
@@ -1202,7 +1202,7 @@ void fio_communicate(int in, int out)
12021202
DIR*dir[FIO_FDMAX];
12031203
structdirent*entry;
12041204
size_tbuf_size=128*1024;
1205-
char*buf= (char*)malloc(buf_size);
1205+
char*buf= (char*)pgut_malloc(buf_size);
12061206
fio_headerhdr;
12071207
structstatst;
12081208
intrc;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp