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

Commit6b34711

Browse files
committed
Allocate 16mb file for testing.
1 parent9e231ba commit6b34711

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

‎src/tools/fsync/test_fsync.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
#endif
3030
#endif
3131

32+
#defineWAL_FILE_SIZE (16 * 1024 * 1024)
33+
3234
voiddie(char*str);
3335
voidprint_elapse(structtimevalstart_t,structtimevalelapse_t);
3436

@@ -40,7 +42,7 @@ main(int argc, char *argv[])
4042
inttmpfile,
4143
i,
4244
loops=1000;
43-
char*strout= (char*)malloc(65536);
45+
char*strout= (char*)malloc(WAL_FILE_SIZE);
4446
char*filename=FSYNC_FILENAME;
4547

4648
if (argc>2&&strcmp(argv[1],"-f")==0)
@@ -53,12 +55,12 @@ main(int argc, char *argv[])
5355
if (argc>1)
5456
loops=atoi(argv[1]);
5557

56-
for (i=0;i<65536;i++)
58+
for (i=0;i<WAL_FILE_SIZE;i++)
5759
strout[i]='a';
5860

5961
if ((tmpfile=open(FSYNC_FILENAME,O_RDWR |O_CREAT,S_IRUSR |S_IWUSR))==-1)
6062
die("can't open /var/tmp/test_fsync.out");
61-
write(tmpfile,strout,65536);
63+
write(tmpfile,strout,WAL_FILE_SIZE);
6264
fsync(tmpfile);/* fsync so later fsync's don't have to do
6365
* it */
6466
close(tmpfile);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp