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
9d03c59c
Commit
9d03c59c
authored
Jul 07, 2006
by
jonas@perch.ndb.mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ndb -
Add DynArr256 which is a ndb-ish judy array Like the one used in ACC
parent
8e11f6f5
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
1111 additions
and
4 deletions
+1111
-4
storage/ndb/src/kernel/vm/DynArr256.cpp
storage/ndb/src/kernel/vm/DynArr256.cpp
+1015
-0
storage/ndb/src/kernel/vm/DynArr256.hpp
storage/ndb/src/kernel/vm/DynArr256.hpp
+79
-0
storage/ndb/src/kernel/vm/Makefile.am
storage/ndb/src/kernel/vm/Makefile.am
+14
-3
storage/ndb/src/kernel/vm/bench_pool.cpp
storage/ndb/src/kernel/vm/bench_pool.cpp
+3
-1
No files found.
storage/ndb/src/kernel/vm/DynArr256.cpp
0 → 100644
View file @
9d03c59c
This diff is collapsed.
Click to expand it.
storage/ndb/src/kernel/vm/DynArr256.hpp
0 → 100644
View file @
9d03c59c
/* Copyright (C) 2003 MySQL AB
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 Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#ifndef DYNARR256_HPP
#define DYNARR256_HPP
#include "Pool.hpp"
class
DynArr256
;
struct
DA256Page
;
class
DynArr256Pool
{
friend
class
DynArr256
;
public:
DynArr256Pool
();
void
init
(
Uint32
type_id
,
const
Pool_context
&
pc
);
protected:
Uint32
m_type_id
;
Uint32
m_first_free
;
Pool_context
m_ctx
;
struct
DA256Page
*
m_memroot
;
private:
Uint32
seize
();
void
release
(
Uint32
);
};
class
DynArr256
{
public:
struct
Head
{
Head
()
{
m_ptr_i
=
RNIL
;
m_sz
=
0
;}
Uint32
m_ptr_i
;
Uint32
m_sz
;
};
DynArr256
(
DynArr256Pool
&
pool
,
Head
&
head
)
:
m_head
(
head
),
m_pool
(
pool
){}
Uint32
*
set
(
Uint32
pos
);
Uint32
*
get
(
Uint32
pos
)
const
;
struct
ReleaseIterator
{
Uint32
m_sz
;
Uint32
m_pos
;
Uint32
m_ptr_i
[
4
];
};
void
init
(
ReleaseIterator
&
);
bool
release
(
ReleaseIterator
&
);
protected:
Head
&
m_head
;
DynArr256Pool
&
m_pool
;
bool
expand
(
Uint32
pos
);
void
handle_invalid_ptr
(
Uint32
pos
,
Uint32
ptrI
,
Uint32
p0
);
};
#endif
storage/ndb/src/kernel/vm/Makefile.am
View file @
9d03c59c
...
...
@@ -20,7 +20,8 @@ libkernel_a_SOURCES = \
Mutex.cpp SafeCounter.cpp
\
Rope.cpp
\
ndbd_malloc.cpp ndbd_malloc_impl.cpp
\
Pool.cpp WOPool.cpp RWPool.cpp
Pool.cpp WOPool.cpp RWPool.cpp
\
DynArr256.cpp
INCLUDES_LOC
=
-I
$(top_srcdir)
/storage/ndb/src/mgmapi
...
...
@@ -44,7 +45,7 @@ libkernel.dsp: Makefile \
@
$(top_srcdir)
/storage/ndb/config/win-sources
$@
$(libkernel_a_SOURCES)
@
$(top_srcdir)
/storage/ndb/config/win-libraries
$@
LIB
$(LDADD)
EXTRA_PROGRAMS
=
ndbd_malloc_impl_test bench_pool
EXTRA_PROGRAMS
=
ndbd_malloc_impl_test bench_pool
testDynArr256
ndbd_malloc_impl_test_CXXFLAGS
=
-DUNIT_TEST
ndbd_malloc_impl_test_SOURCES
=
ndbd_malloc_impl.cpp
ndbd_malloc_impl_test_LDFLAGS
=
@ndb_bin_am_ldflags@
\
...
...
@@ -54,9 +55,19 @@ ndbd_malloc_impl_test_LDFLAGS = @ndb_bin_am_ldflags@ \
$(top_builddir)
/strings/libmystrings.a
bench_pool_SOURCES
=
bench_pool.cpp
bench_pool_LDFLAGS
=
@ndb_bin_am_ldflags@
../SimBlockList.o
\
bench_pool_LDFLAGS
=
@ndb_bin_am_ldflags@
\
libkernel.a ../error/liberror.a
\
$(top_builddir)
/storage/ndb/src/libndbclient.la
\
$(top_builddir)
/mysys/libmysys.a
\
$(top_builddir)
/dbug/libdbug.a
\
$(top_builddir)
/strings/libmystrings.a
testDynArr256_CXXFLAGS
=
-DUNIT_TEST
testDynArr256_SOURCES
=
DynArr256.cpp
testDynArr256_LDFLAGS
=
@ndb_bin_am_ldflags@
\
libkernel.a ../error/liberror.a
\
$(top_builddir)
/storage/ndb/src/libndbclient.la
\
$(top_builddir)
/mysys/libmysys.a
\
$(top_builddir)
/dbug/libdbug.a
\
$(top_builddir)
/strings/libmystrings.a
storage/ndb/src/kernel/vm/bench_pool.cpp
View file @
9d03c59c
...
...
@@ -60,7 +60,7 @@ Uint32 sizes = 7;
unsigned
int
seed
;
Ndbd_mem_manager
mm
;
Configuration
cfg
;
Block_context
ctx
=
{
cfg
,
mm
}
;
Block_context
ctx
(
cfg
,
mm
)
;
struct
BB
:
public
SimulatedBlock
{
BB
(
int
no
,
Block_context
&
ctx
)
:
SimulatedBlock
(
no
,
ctx
)
{}
...
...
@@ -548,6 +548,8 @@ main(int argc, char **argv)
}
Uint32
g_currentStartPhase
;
Uint32
g_start_type
;
NdbNodeBitmask
g_nowait_nodes
;
void
childExit
(
int
code
,
Uint32
currentStartPhase
)
{
...
...
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