Skip to content

Commit 33e9c1b

Browse files
committed
Stop using mmap by default for performance and safetiness ##io
1 parent d453c81 commit 33e9c1b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

libr/io/p/io_default.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,16 +113,18 @@ static RIOMMapFileObj *mmap_create(RIO *io, const char *filename, int perm, int
113113
RIOMMapFileObj *mmo = R_NEW0 (RIOMMapFileObj);
114114
if (r_str_startswith (filename, "file://")) {
115115
filename += strlen ("file://");
116+
mmo->rawio = false; // causes test_io_buf to fail if set to true
116117
} else if (r_str_startswith (filename, "stdio://")) {
117118
filename += strlen ("stdio://");
118119
mmo->rawio = true;
119120
} else if (r_str_startswith (filename, "nocache://")) {
120121
mmo->rawio = true;
121122
mmo->nocache = true;
122123
} else {
123-
// TODO later: mmo->rawio = true;
124+
mmo->rawio = true;
124125
}
125126
if (mmo->nocache) {
127+
// TODO later: mmo->rawio = true;
126128
filename += strlen ("nocache://");
127129
}
128130
mmo->filename = strdup (filename);

0 commit comments

Comments
 (0)