File tree Expand file tree Collapse file tree 3 files changed +8
-2
lines changed Expand file tree Collapse file tree 3 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -1350,6 +1350,12 @@ struct os_aio_userdata_t
1350
1350
fil_node_t * node;
1351
1351
IORequest type;
1352
1352
void * message;
1353
+
1354
+ os_aio_userdata_t (fil_node_t *node, IORequest type, void *message) :
1355
+ node (node), type(type), message(message) {}
1356
+
1357
+ /* * Construct from tpool::aiocb::m_userdata[] */
1358
+ os_aio_userdata_t (const char *buf) { memcpy ((void *)this , buf, sizeof *this ); }
1353
1359
};
1354
1360
/* *
1355
1361
NOTE! Use the corresponding macro os_aio(), not directly this function!
Original file line number Diff line number Diff line change @@ -3883,7 +3883,7 @@ extern void fil_aio_callback(os_aio_userdata_t *data);
3883
3883
static void io_callback (tpool::aiocb* cb)
3884
3884
{
3885
3885
ut_a (cb->m_err == DB_SUCCESS);
3886
- os_aio_userdata_t data = *( os_aio_userdata_t *) cb->m_userdata ;
3886
+ os_aio_userdata_t data ( cb->m_userdata ) ;
3887
3887
/* Return cb back to cache*/
3888
3888
if (cb->m_opcode == tpool::aio_opcode::AIO_PREAD) {
3889
3889
if (read_slots->contains (cb)) {
Original file line number Diff line number Diff line change @@ -137,7 +137,7 @@ struct aiocb
137
137
int m_err;
138
138
void *m_internal;
139
139
task m_internal_task;
140
- char m_userdata[MAX_AIO_USERDATA_LEN];
140
+ alignas ( 8 ) char m_userdata[MAX_AIO_USERDATA_LEN];
141
141
142
142
aiocb () : m_internal_task(nullptr , nullptr )
143
143
{}
You can’t perform that action at this time.
0 commit comments