mirror of
https://github.com/MariaDB/server.git
synced 2026-05-15 19:37:16 +02:00
Merge branch '10.2' into 10.3
This commit is contained in:
commit
58b70dc136
23 changed files with 129 additions and 90 deletions
|
|
@ -184,6 +184,18 @@ do {\
|
|||
HASH_INVALIDATE(DATA, NAME);\
|
||||
} while (0)
|
||||
|
||||
#define HASH_REPLACE(TYPE, NAME, TABLE, FOLD, DATA_OLD, DATA_NEW) \
|
||||
do { \
|
||||
(DATA_NEW)->NAME = (DATA_OLD)->NAME; \
|
||||
\
|
||||
hash_cell_t& cell3333 \
|
||||
= TABLE->array[hash_calc_hash(FOLD, TABLE)]; \
|
||||
TYPE** struct3333 = (TYPE**)&cell3333.node; \
|
||||
while (*struct3333 != DATA_OLD) { \
|
||||
struct3333 = &((*struct3333)->NAME); \
|
||||
} \
|
||||
*struct3333 = DATA_NEW; \
|
||||
} while (0)
|
||||
/*******************************************************************//**
|
||||
Gets the first struct in a hash chain, NULL if none. */
|
||||
|
||||
|
|
|
|||
|
|
@ -291,13 +291,6 @@ mem_heap_printf(
|
|||
const char* format, /*!< in: format string */
|
||||
...) MY_ATTRIBUTE ((format (printf, 2, 3)));
|
||||
|
||||
/** Checks that an object is a memory heap (or a block of it)
|
||||
@param[in] heap Memory heap to check */
|
||||
UNIV_INLINE
|
||||
void
|
||||
mem_block_validate(
|
||||
const mem_heap_t* heap);
|
||||
|
||||
#ifdef UNIV_DEBUG
|
||||
/** Validates the contents of a memory heap.
|
||||
Asserts that the memory heap is consistent
|
||||
|
|
@ -312,7 +305,6 @@ mem_heap_validate(
|
|||
|
||||
/** The info structure stored at the beginning of a heap block */
|
||||
struct mem_block_info_t {
|
||||
ulint magic_n;/* magic number for debugging */
|
||||
#ifdef UNIV_DEBUG
|
||||
char file_name[8];/* file name where the mem heap was created */
|
||||
unsigned line; /*!< line number where the mem heap was created */
|
||||
|
|
@ -347,9 +339,6 @@ struct mem_block_info_t {
|
|||
otherwise, this is NULL */
|
||||
};
|
||||
|
||||
#define MEM_BLOCK_MAGIC_N 764741555
|
||||
#define MEM_FREED_BLOCK_MAGIC_N 547711122
|
||||
|
||||
/* Header size for a memory heap block */
|
||||
#define MEM_BLOCK_HEADER_SIZE UT_CALC_ALIGN(sizeof(mem_block_info_t),\
|
||||
UNIV_MEM_ALIGNMENT)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/*****************************************************************************
|
||||
|
||||
Copyright (c) 1994, 2014, Oracle and/or its affiliates. All Rights Reserved.
|
||||
Copyright (c) 2017, MariaDB Corporation.
|
||||
Copyright (c) 2017, 2020, MariaDB Corporation.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it under
|
||||
the terms of the GNU General Public License as published by the Free Software
|
||||
|
|
@ -144,16 +144,6 @@ mem_block_get_start(mem_block_t* block)
|
|||
return(block->start);
|
||||
}
|
||||
|
||||
/** Checks that an object is a memory heap block
|
||||
@param[in] block Memory block to check. */
|
||||
UNIV_INLINE
|
||||
void
|
||||
mem_block_validate(
|
||||
const mem_block_t* block)
|
||||
{
|
||||
ut_a(block->magic_n == MEM_BLOCK_MAGIC_N);
|
||||
}
|
||||
|
||||
/** Allocates and zero-fills n bytes of memory from a memory heap.
|
||||
@param[in] heap memory heap
|
||||
@param[in] n number of bytes; if the heap is allowed to grow into
|
||||
|
|
@ -186,8 +176,6 @@ mem_heap_alloc(
|
|||
byte* buf;
|
||||
ulint free;
|
||||
|
||||
ut_d(mem_block_validate(heap));
|
||||
|
||||
block = UT_LIST_GET_LAST(heap->base);
|
||||
|
||||
n += REDZONE_SIZE;
|
||||
|
|
@ -230,8 +218,6 @@ mem_heap_get_heap_top(
|
|||
mem_block_t* block;
|
||||
byte* buf;
|
||||
|
||||
ut_d(mem_block_validate(heap));
|
||||
|
||||
block = UT_LIST_GET_LAST(heap->base);
|
||||
|
||||
buf = (byte*) block + mem_block_get_free(block);
|
||||
|
|
@ -322,8 +308,6 @@ mem_heap_get_top(
|
|||
mem_block_t* block;
|
||||
byte* buf;
|
||||
|
||||
ut_d(mem_block_validate(heap));
|
||||
|
||||
block = UT_LIST_GET_LAST(heap->base);
|
||||
|
||||
buf = (byte*) block + mem_block_get_free(block) - MEM_SPACE_NEEDED(n);
|
||||
|
|
@ -343,8 +327,6 @@ mem_heap_free_top(
|
|||
{
|
||||
mem_block_t* block;
|
||||
|
||||
ut_d(mem_block_validate(heap));
|
||||
|
||||
n += REDZONE_SIZE;
|
||||
|
||||
block = UT_LIST_GET_LAST(heap->base);
|
||||
|
|
@ -420,8 +402,6 @@ mem_heap_free(
|
|||
mem_block_t* block;
|
||||
mem_block_t* prev_block;
|
||||
|
||||
ut_d(mem_block_validate(heap));
|
||||
|
||||
block = UT_LIST_GET_LAST(heap->base);
|
||||
|
||||
if (heap->free_block) {
|
||||
|
|
@ -448,11 +428,7 @@ mem_heap_get_size(
|
|||
/*==============*/
|
||||
mem_heap_t* heap) /*!< in: heap */
|
||||
{
|
||||
ulint size = 0;
|
||||
|
||||
ut_d(mem_block_validate(heap));
|
||||
|
||||
size = heap->total_size;
|
||||
ulint size = heap->total_size;
|
||||
|
||||
if (heap->free_block) {
|
||||
size += srv_page_size;
|
||||
|
|
|
|||
|
|
@ -1410,7 +1410,11 @@ rec_get_converted_size(
|
|||
|
||||
data_size = dtuple_get_data_size(dtuple, 0);
|
||||
|
||||
ut_ad(n_ext == dtuple_get_n_ext(dtuple));
|
||||
/* If primary key is being updated then the new record inherits
|
||||
externally stored fields from the delete-marked old record.
|
||||
In that case, n_ext may be less value than
|
||||
dtuple_get_n_ext(tuple). */
|
||||
ut_ad(n_ext <= dtuple_get_n_ext(dtuple));
|
||||
extra_size = rec_get_converted_extra_size(
|
||||
data_size, dtuple_get_n_fields(dtuple), n_ext);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue