~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/innobase/mem/mem0mem.c

  • Committer: Brian Aker
  • Date: 2010-12-26 00:07:57 UTC
  • Revision ID: brian@tangent.org-20101226000757-ysntnltqywxoe1em
MErge in the include changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
*************************************************************************/
25
25
 
26
26
#include "mem0mem.h"
27
 
 
28
27
#ifdef UNIV_NONINL
29
28
#include "mem0mem.ic"
30
29
#endif
31
30
 
32
31
#include "buf0buf.h"
33
32
#include "srv0srv.h"
34
 
#include "mem0dbg.cc"
 
33
#include "mem0dbg.c"
35
34
#include <stdarg.h>
36
35
 
37
36
/*
109
108
        mem_heap_t*     heap,   /*!< in: memory heap where string is allocated */
110
109
        const char*     str)    /*!< in: string to be copied */
111
110
{
112
 
        return(static_cast<char *>(mem_heap_dup(heap, str, strlen(str) + 1)));
 
111
        return(mem_heap_dup(heap, str, strlen(str) + 1));
113
112
}
114
113
 
115
114
/**********************************************************************//**
141
140
        ulint   s1_len = strlen(s1);
142
141
        ulint   s2_len = strlen(s2);
143
142
 
144
 
        s = static_cast<char *>(mem_heap_alloc(heap, s1_len + s2_len + 1));
 
143
        s = mem_heap_alloc(heap, s1_len + s2_len + 1);
145
144
 
146
145
        memcpy(s, s1, s1_len);
147
146
        memcpy(s + s1_len, s2, s2_len);
286
285
        va_end(ap);
287
286
 
288
287
        /* Now create it for real. */
289
 
        str = static_cast<char *>(mem_heap_alloc(heap, len));
 
288
        str = mem_heap_alloc(heap, len);
290
289
        va_start(ap, format);
291
290
        mem_heap_printf_low(str, format, ap);
292
291
        va_end(ap);
331
330
 
332
331
                ut_ad(type == MEM_HEAP_DYNAMIC || n <= MEM_MAX_ALLOC_IN_BUF);
333
332
 
334
 
                block = static_cast<mem_block_info_t *>(mem_area_alloc(&len, mem_comm_pool));
 
333
                block = mem_area_alloc(&len, mem_comm_pool);
335
334
        } else {
336
335
                len = UNIV_PAGE_SIZE;
337
336
 
340
339
                        buffer pool, but must get the free block from
341
340
                        the heap header free block field */
342
341
 
343
 
                        buf_block = static_cast<buf_block_t *>(heap->free_block);
 
342
                        buf_block = heap->free_block;
344
343
                        heap->free_block = NULL;
345
344
 
346
345
                        if (UNIV_UNLIKELY(!buf_block)) {
470
469
        ulint           type;
471
470
        ulint           len;
472
471
#ifndef UNIV_HOTBACKUP
473
 
        buf_block_t*    buf_block       = static_cast<buf_block_t *>(block->buf_block);
 
472
        buf_block_t*    buf_block       = block->buf_block;
474
473
#endif /* !UNIV_HOTBACKUP */
475
474
 
476
475
        if (block->magic_n != MEM_BLOCK_MAGIC_N) {
537
536
{
538
537
        if (UNIV_LIKELY_NULL(heap->free_block)) {
539
538
 
540
 
                buf_block_free(static_cast<buf_block_t *>(heap->free_block));
 
539
                buf_block_free(heap->free_block);
541
540
 
542
541
                heap->free_block = NULL;
543
542
        }