~ubuntu-branches/ubuntu/maverick/mysql-5.1/maverick-proposed

« back to all changes in this revision

Viewing changes to storage/innodb_plugin/include/buf0buddy.h

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2012-02-22 14:16:05 UTC
  • mto: This revision was merged to the branch mainline in revision 20.
  • Revision ID: package-import@ubuntu.com-20120222141605-nxlu9yzc6attylc2
Tags: upstream-5.1.61
ImportĀ upstreamĀ versionĀ 5.1.61

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*****************************************************************************
2
2
 
3
 
Copyright (c) 2006, 2009, Innobase Oy. All Rights Reserved.
 
3
Copyright (c) 2006, 2011, Oracle and/or its affiliates. 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
37
37
/**********************************************************************//**
38
38
Allocate a block.  The thread calling this function must hold
39
39
buf_pool_mutex and must not hold buf_pool_zip_mutex or any
40
 
block->mutex.  The buf_pool_mutex may only be released and reacquired
41
 
if lru != NULL.  This function should only be used for allocating
42
 
compressed page frames or control blocks (buf_page_t).  Allocated
43
 
control blocks must be properly initialized immediately after
44
 
buf_buddy_alloc() has returned the memory, before releasing
45
 
buf_pool_mutex.
46
 
@return allocated block, possibly NULL if lru == NULL */
 
40
block->mutex.  The buf_pool_mutex may be released and reacquired.
 
41
This function should only be used for allocating compressed page frames.
 
42
@return allocated block, never NULL */
47
43
UNIV_INLINE
48
44
void*
49
45
buf_buddy_alloc(
50
46
/*============*/
51
 
        ulint   size,   /*!< in: block size, up to UNIV_PAGE_SIZE */
 
47
        ulint   size,   /*!< in: compressed page size
 
48
                        (between PAGE_ZIP_MIN_SIZE and UNIV_PAGE_SIZE) */
52
49
        ibool*  lru)    /*!< in: pointer to a variable that will be assigned
53
50
                        TRUE if storage was allocated from the LRU list
54
 
                        and buf_pool_mutex was temporarily released,
55
 
                        or NULL if the LRU list should not be used */
56
 
        __attribute__((malloc));
57
 
 
 
51
                        and buf_pool_mutex was temporarily released */
 
52
        __attribute__((malloc, nonnull));
58
53
/**********************************************************************//**
59
54
Release a block. */
60
55
UNIV_INLINE