summaryrefslogtreecommitdiff
path: root/storage/innobase/include/rem0rec.h
diff options
context:
space:
mode:
Diffstat (limited to 'storage/innobase/include/rem0rec.h')
-rw-r--r--storage/innobase/include/rem0rec.h18
1 files changed, 8 insertions, 10 deletions
diff --git a/storage/innobase/include/rem0rec.h b/storage/innobase/include/rem0rec.h
index 797e945acbd..23c25f76362 100644
--- a/storage/innobase/include/rem0rec.h
+++ b/storage/innobase/include/rem0rec.h
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2017, 2018, 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
@@ -678,19 +678,17 @@ rec_offs_make_nth_extern(
rec_offs* offsets,
const ulint n);
+MY_ATTRIBUTE((nonnull))
/** Determine the number of allocated elements for an array of offsets.
@param[in] offsets offsets after rec_offs_set_n_alloc()
@return number of elements */
-inline
-ulint
-rec_offs_get_n_alloc(const rec_offs* offsets)
+inline ulint rec_offs_get_n_alloc(const rec_offs *offsets)
{
- ulint n_alloc;
- ut_ad(offsets);
- n_alloc = offsets[0];
- ut_ad(n_alloc > REC_OFFS_HEADER_SIZE);
- UNIV_MEM_ASSERT_W(offsets, n_alloc * sizeof *offsets);
- return(n_alloc);
+ ut_ad(offsets);
+ ulint n_alloc= offsets[0];
+ ut_ad(n_alloc > REC_OFFS_HEADER_SIZE);
+ MEM_CHECK_ADDRESSABLE(offsets, n_alloc * sizeof *offsets);
+ return n_alloc;
}
/** Determine the number of fields for which offsets have been initialized.