134
134
/***********************************************************************//**
135
Free's an instance of the rollback segment in memory. */
140
trx_rseg_t* rseg) /* in, own: instance to free */
144
mutex_free(&rseg->mutex);
146
/* There can't be any active transactions. */
147
ut_a(UT_LIST_GET_LEN(rseg->update_undo_list) == 0);
148
ut_a(UT_LIST_GET_LEN(rseg->insert_undo_list) == 0);
150
undo = UT_LIST_GET_FIRST(rseg->update_undo_cached);
152
while (undo != NULL) {
153
trx_undo_t* prev_undo = undo;
155
undo = UT_LIST_GET_NEXT(undo_list, undo);
156
UT_LIST_REMOVE(undo_list, rseg->update_undo_cached, prev_undo);
158
trx_undo_mem_free(prev_undo);
161
undo = UT_LIST_GET_FIRST(rseg->insert_undo_cached);
163
while (undo != NULL) {
164
trx_undo_t* prev_undo = undo;
166
undo = UT_LIST_GET_NEXT(undo_list, undo);
167
UT_LIST_REMOVE(undo_list, rseg->insert_undo_cached, prev_undo);
169
trx_undo_mem_free(prev_undo);
172
trx_sys_set_nth_rseg(trx_sys, rseg->id, NULL);
177
/***************************************************************************
178
135
Creates and initializes a rollback segment object. The values for the
179
136
fields are read from the header. The object is inserted to the rseg
180
137
list of the trx system object and a pointer is inserted in the rseg