agnivade / frodo Goto Github PK
View Code? Open in Web Editor NEWDemo API to play with io_uring in Go
License: MIT License
Demo API to play with io_uring in Go
License: MIT License
The golang doc says
C code may store Go pointers in C memory, subject to the rule above: it must stop storing the Go pointer when the C function returns.
however in this line
Line 105 in 55a39bb
push_write_request
function returns.
int push_write_request(int file_fd, void *data, off_t file_sz) {
struct file_info *fi = malloc(sizeof(*fi) + (sizeof(struct iovec) * 1));
...
fi->iovecs[0].iov_base = data;
...
io_uring_sqe_set_data(sqe, fi);
return 0;
}
while this may work in some cases where the gc doesnt run till the file is written to, it is very possible that the gc runs after this call to push_write_request
and relocates the data
buffer to a whole different address. in fact for the zeroBytes
buffer case
Line 173 in 55a39bb
push_write_request
callA declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.