@@ -257,38 +257,13 @@ class mtr_buf_t {
257257 while (len > 0 ) {
258258 uint32_t n_copied = std::min (len,
259259 uint32_t (MAX_DATA_SIZE));
260- ::memmove (push<byte*>(n_copied), ptr, n_copied);
260+ ::memcpy (push<byte*>(n_copied), ptr, n_copied);
261261
262262 ptr += n_copied;
263263 len -= n_copied;
264264 }
265265 }
266266
267- /* *
268- Returns a pointer to an element in the buffer. const version.
269- @param pos position of element in bytes from start
270- @return pointer to element */
271- template <typename Type>
272- const Type at (ulint pos) const
273- {
274- block_t * block = const_cast <block_t *>(
275- const_cast <mtr_buf_t *>(this )->find (pos));
276-
277- return (reinterpret_cast <Type>(block->begin () + pos));
278- }
279-
280- /* *
281- Returns a pointer to an element in the buffer. non const version.
282- @param pos position of element in bytes from start
283- @return pointer to element */
284- template <typename Type>
285- Type at (ulint pos)
286- {
287- block_t * block = const_cast <block_t *>(find (pos));
288-
289- return (reinterpret_cast <Type>(block->begin () + pos));
290- }
291-
292267 /* *
293268 Returns the size of the total stored data.
294269 @return data size in bytes */
@@ -377,29 +352,6 @@ class mtr_buf_t {
377352 return (back ()->m_used + size <= MAX_DATA_SIZE);
378353 }
379354
380- /* * Find the block that contains the pos.
381- @param pos absolute offset, it is updated to make it relative
382- to the block
383- @return the block containing the pos. */
384- block_t * find (ulint& pos)
385- {
386- ut_ad (!m_list.empty ());
387-
388- for (list_t ::iterator it = m_list.begin (), end = m_list.end ();
389- it != end; ++it) {
390-
391- if (pos < it->used ()) {
392- ut_ad (it->used () >= pos);
393-
394- return &*it;
395- }
396-
397- pos -= it->used ();
398- }
399-
400- return NULL ;
401- }
402-
403355 /* *
404356 Allocate and add a new block to m_list */
405357 block_t * add_block ()
0 commit comments