~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/innobase/trx/trx0sys.cc

merged with up to date trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*****************************************************************************
2
2
 
3
 
Copyright (c) 1996, 2010, Innobase Oy. All Rights Reserved.
 
3
Copyright (C) 1996, 2010, Innobase Oy. All Rights Reserved.
4
4
 
5
5
This program is free software; you can redistribute it and/or modify it under
6
6
the terms of the GNU General Public License as published by the Free Software
178
178
        byte*   doublewrite)    /*!< in: pointer to the doublewrite buf
179
179
                                header on trx sys page */
180
180
{
181
 
        trx_doublewrite = mem_alloc(sizeof(trx_doublewrite_t));
 
181
  trx_doublewrite = static_cast<trx_doublewrite_t *>(mem_alloc(sizeof(trx_doublewrite_t)));
182
182
 
183
183
        /* Since we now start to use the doublewrite buffer, no need to call
184
184
        fsync() after every write to a data file */
195
195
                doublewrite + TRX_SYS_DOUBLEWRITE_BLOCK1);
196
196
        trx_doublewrite->block2 = mach_read_from_4(
197
197
                doublewrite + TRX_SYS_DOUBLEWRITE_BLOCK2);
198
 
        trx_doublewrite->write_buf_unaligned = ut_malloc(
199
 
                (1 + 2 * TRX_SYS_DOUBLEWRITE_BLOCK_SIZE) * UNIV_PAGE_SIZE);
 
198
        trx_doublewrite->write_buf_unaligned = static_cast<byte *>(ut_malloc(
 
199
                                                                             (1 + 2 * TRX_SYS_DOUBLEWRITE_BLOCK_SIZE) * UNIV_PAGE_SIZE));
200
200
 
201
 
        trx_doublewrite->write_buf = ut_align(
202
 
                trx_doublewrite->write_buf_unaligned, UNIV_PAGE_SIZE);
203
 
        trx_doublewrite->buf_block_arr = mem_alloc(
204
 
                2 * TRX_SYS_DOUBLEWRITE_BLOCK_SIZE * sizeof(void*));
 
201
        trx_doublewrite->write_buf = static_cast<byte *>(ut_align(
 
202
                                                                  trx_doublewrite->write_buf_unaligned, UNIV_PAGE_SIZE));
 
203
        trx_doublewrite->buf_block_arr = static_cast<buf_page_t **>(mem_alloc(
 
204
                                                                             2 * TRX_SYS_DOUBLEWRITE_BLOCK_SIZE * sizeof(void*)));
205
205
}
206
206
 
207
207
/****************************************************************//**
440
440
 
441
441
        /* We do the file i/o past the buffer pool */
442
442
 
443
 
        unaligned_read_buf = ut_malloc(2 * UNIV_PAGE_SIZE);
444
 
        read_buf = ut_align(unaligned_read_buf, UNIV_PAGE_SIZE);
 
443
        unaligned_read_buf = static_cast<byte *>(ut_malloc(2 * UNIV_PAGE_SIZE));
 
444
        read_buf = static_cast<byte *>(ut_align(unaligned_read_buf, UNIV_PAGE_SIZE));
445
445
 
446
446
        /* Read the trx sys header to check if we are using the doublewrite
447
447
        buffer */
965
965
 
966
966
        mutex_enter(&kernel_mutex);
967
967
 
968
 
        trx_sys = mem_alloc(sizeof(trx_sys_t));
 
968
        trx_sys = static_cast<trx_sys_t *>(mem_alloc(sizeof(trx_sys_t)));
969
969
 
970
970
        sys_header = trx_sysf_get(&mtr);
971
971
 
1595
1595
                        "InnoDB: Error: all read views were not closed"
1596
1596
                        " before shutdown:\n"
1597
1597
                        "InnoDB: %lu read views open \n",
1598
 
                        UT_LIST_GET_LEN(trx_sys->view_list) - 1);
 
1598
                        static_cast<ulint>(UT_LIST_GET_LEN(trx_sys->view_list)) - 1);
1599
1599
        }
1600
1600
 
1601
1601
        sess_close(trx_dummy_sess);