mirror of
https://github.com/MariaDB/server.git
synced 2025-08-30 11:22:14 +03:00
Applying InnoDB Plugin 1.0.6 snapshot,part 1. Fixes BUG#45992 and BUG#46656
Detailed revision comments: r6130 | marko | 2009-11-02 11:42:56 +0200 (Mon, 02 Nov 2009) | 9 lines branches/zip: Free all resources at shutdown. Set pointers to NULL, so that Valgrind will not complain about freed data structures that are reachable via pointers. This addresses Bug #45992 and Bug #46656. This patch is mostly based on changes copied from branches/embedded-1.0, mainly c5432, c3439, c3134, c2994, c2978, but also some other code was copied. Some added cleanup code is specific to MySQL/InnoDB. rb://199 approved by Sunny Bains
This commit is contained in:
@@ -227,24 +227,21 @@ sync_array_create(
|
||||
SYNC_ARRAY_MUTEX: determines the type
|
||||
of mutex protecting the data structure */
|
||||
{
|
||||
ulint sz;
|
||||
sync_array_t* arr;
|
||||
sync_cell_t* cell_array;
|
||||
sync_cell_t* cell;
|
||||
ulint i;
|
||||
|
||||
ut_a(n_cells > 0);
|
||||
|
||||
/* Allocate memory for the data structures */
|
||||
arr = ut_malloc(sizeof(sync_array_t));
|
||||
memset(arr, 0x0, sizeof(*arr));
|
||||
|
||||
cell_array = ut_malloc(sizeof(sync_cell_t) * n_cells);
|
||||
sz = sizeof(sync_cell_t) * n_cells;
|
||||
arr->array = ut_malloc(sz);
|
||||
memset(arr->array, 0x0, sz);
|
||||
|
||||
arr->n_cells = n_cells;
|
||||
arr->n_reserved = 0;
|
||||
arr->array = cell_array;
|
||||
arr->protection = protection;
|
||||
arr->sg_count = 0;
|
||||
arr->res_count = 0;
|
||||
|
||||
/* Then create the mutex to protect the wait array complex */
|
||||
if (protection == SYNC_ARRAY_OS_MUTEX) {
|
||||
@@ -255,13 +252,6 @@ sync_array_create(
|
||||
ut_error;
|
||||
}
|
||||
|
||||
for (i = 0; i < n_cells; i++) {
|
||||
cell = sync_array_get_nth_cell(arr, i);
|
||||
cell->wait_object = NULL;
|
||||
cell->waiting = FALSE;
|
||||
cell->signal_count = 0;
|
||||
}
|
||||
|
||||
return(arr);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user