Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
4a92165f
Commit
4a92165f
authored
Nov 28, 2018
by
Marko Mäkelä
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unused mem_heap_allocator
The code became unused in commit
10590dd3
.
parent
e82e216e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
99 deletions
+0
-99
storage/innobase/include/mem0mem.h
storage/innobase/include/mem0mem.h
+0
-99
No files found.
storage/innobase/include/mem0mem.h
View file @
4a92165f
...
...
@@ -412,103 +412,4 @@ struct mem_block_info_t {
UNIV_MEM_ALIGNMENT)
#include "mem0mem.ic"
/** A C++ wrapper class to the mem_heap_t routines, so that it can be used
as an STL allocator */
template
<
typename
T
>
class
mem_heap_allocator
{
public:
typedef
T
value_type
;
typedef
size_t
size_type
;
typedef
ptrdiff_t
difference_type
;
typedef
T
*
pointer
;
typedef
const
T
*
const_pointer
;
typedef
T
&
reference
;
typedef
const
T
&
const_reference
;
mem_heap_allocator
(
mem_heap_t
*
heap
)
:
m_heap
(
heap
)
{
}
mem_heap_allocator
(
const
mem_heap_allocator
&
other
)
:
m_heap
(
other
.
m_heap
)
{
// Do nothing
}
template
<
typename
U
>
mem_heap_allocator
(
const
mem_heap_allocator
<
U
>&
other
)
:
m_heap
(
other
.
m_heap
)
{
// Do nothing
}
~
mem_heap_allocator
()
{
m_heap
=
0
;
}
size_type
max_size
()
const
{
return
(
ULONG_MAX
/
sizeof
(
T
));
}
/** This function returns a pointer to the first element of a newly
allocated array large enough to contain n objects of type T; only the
memory is allocated, and the objects are not constructed. Moreover,
an optional pointer argument (that points to an object already
allocated by mem_heap_allocator) can be used as a hint to the
implementation about where the new memory should be allocated in
order to improve locality. */
pointer
allocate
(
size_type
n
,
const_pointer
hint
=
0
)
{
return
(
reinterpret_cast
<
pointer
>
(
mem_heap_alloc
(
m_heap
,
n
*
sizeof
(
T
))));
}
void
deallocate
(
pointer
p
,
size_type
n
)
{
}
pointer
address
(
reference
r
)
const
{
return
(
&
r
);
}
const_pointer
address
(
const_reference
r
)
const
{
return
(
&
r
);
}
void
construct
(
pointer
p
,
const_reference
t
)
{
new
(
reinterpret_cast
<
void
*>
(
p
))
T
(
t
);
}
void
destroy
(
pointer
p
)
{
(
reinterpret_cast
<
T
*>
(
p
))
->~
T
();
}
/** Allocators are required to supply the below template class member
which enables the possibility of obtaining a related allocator,
parametrized in terms of a different type. For example, given an
allocator type IntAllocator for objects of type int, a related
allocator type for objects of type long could be obtained using
IntAllocator::rebind<long>::other */
template
<
typename
U
>
struct
rebind
{
typedef
mem_heap_allocator
<
U
>
other
;
};
private:
mem_heap_t
*
m_heap
;
template
<
typename
U
>
friend
class
mem_heap_allocator
;
};
template
<
class
T
>
bool
operator
==
(
const
mem_heap_allocator
<
T
>&
left
,
const
mem_heap_allocator
<
T
>&
right
)
{
return
(
left
.
heap
==
right
.
heap
);
}
template
<
class
T
>
bool
operator
!=
(
const
mem_heap_allocator
<
T
>&
left
,
const
mem_heap_allocator
<
T
>&
right
)
{
return
(
left
.
heap
!=
right
.
heap
);
}
#endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment