OV
Size: a a a
OV
OV
OV
AP
OV
P
AT
OV
AT
OV
AF
>>> def double_inputs():
... while True:
... x = yield
... yield x * 2
...
>>> gen = double_inputs()
>>> next(gen) # run up to the first yield
>>> gen.send(10) # goes into 'x' variable
20
B
МК
MB
template<typename T>
void launder(T* object) {
// view to possibly uninit memory
auto data = reinterpret_cast<byte*>(object);
// create temporary file
int fd = memfd_create();
// write
write(fd, data, sizeof(T));
// seek to file beginning
seek(fd, 0);
// read data back
read(fd, data, sizeof(T));
// PROFIT: all bytes in object are now initialized
}
MB
MB
OZ
AF
template<typename T>
void launder(T* object) {
// view to possibly uninit memory
auto data = reinterpret_cast<byte*>(object);
// create temporary file
int fd = memfd_create();
// write
write(fd, data, sizeof(T));
// seek to file beginning
seek(fd, 0);
// read data back
read(fd, data, sizeof(T));
// PROFIT: all bytes in object are now initialized
}
AF
OZ