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
1c2f00c3
Commit
1c2f00c3
authored
Sep 14, 2007
by
Rich Prohaska
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add primes.o, fix some memory leaks
git-svn-id:
file:///svn/tokudb@307
c7de825b-a66e-492c-adef-691d508d4ae1
parent
1c3c6f5e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
5 deletions
+17
-5
src/Makefile
src/Makefile
+1
-1
src/ydb.c
src/ydb.c
+16
-4
No files found.
src/Makefile
View file @
1c2f00c3
...
...
@@ -8,7 +8,7 @@ clean:
rm
-rf
*
.so
*
.o
ydb.o
:
../include/db.h ../newbrt/cachetable.h
DBBINS
=
ydb.o ../newbrt/brt.o ../newbrt/brt-serialize.o ../newbrt/cachetable.o ../newbrt/hashtable.o ../newbrt/header-io.o ../newbrt/key.o ../newbrt/memory.o ../newbrt/pma.o ../newbrt/ybt.o
DBBINS
=
ydb.o ../newbrt/brt.o ../newbrt/brt-serialize.o ../newbrt/cachetable.o ../newbrt/hashtable.o ../newbrt/header-io.o ../newbrt/key.o ../newbrt/memory.o ../newbrt/pma.o ../newbrt/ybt.o
../newbrt/primes.o
libdb.so
:
$(DBBINS)
cc
$(CPPFLAGS)
$(DBBINS)
-shared
-o
libdb.so
$(CFLAGS)
libdb.a(ydb.o)
:
ydb.o
src/ydb.c
View file @
1c2f00c3
...
...
@@ -97,8 +97,12 @@ int __toku_db_env_open (DB_ENV *env, const char *home, u_int32_t flags, int mod
return
0
;
}
int
__toku_db_env_close
(
DB_ENV
*
env
,
u_int32_t
flags
)
{
barf
();
return
1
;
cachetable_close
(
&
env
->
i
->
cachetable
);
free
(
env
->
i
->
dir
);
free
(
env
->
i
->
files
);
free
(
env
->
i
);
free
(
env
);
return
0
;
}
int
__toku_db_env_log_archive
(
DB_ENV
*
env
,
char
**
list
[],
u_int32_t
flags
)
{
*
list
=
NULL
;
...
...
@@ -251,6 +255,10 @@ int __toku_db_close (DB *db, u_int32_t flags) {
int
r
=
close_brt
(
db
->
i
->
brt
);
printf
(
"%s:%d %d=__toku_db_close(%p)
\n
"
,
__FILE__
,
__LINE__
,
r
,
db
);
db
->
i
->
freed
=
1
;
free
(
db
->
i
->
database_name
);
free
(
db
->
i
->
full_fname
);
free
(
db
->
i
);
free
(
db
);
return
r
;
}
...
...
@@ -267,6 +275,8 @@ int __toku_c_get (DBC *c, DBT *key, DBT *data, u_int32_t flag) {
int
__toku_c_close
(
DBC
*
c
)
{
int
r
=
brt_cursor_close
(
c
->
i
->
c
);
printf
(
"%s:%d %d=__toku_c_close(%p)
\n
"
,
__FILE__
,
__LINE__
,
r
,
c
);
free
(
c
->
i
);
free
(
c
);
return
r
;
}
...
...
@@ -345,7 +355,7 @@ int __toku_db_open (DB *db, DB_TXN *txn, const char *fname, const char *dbname,
if
(
db
->
i
->
full_fname
)
return
-
1
;
/* It was already open. */
db
->
i
->
full_fname
=
construct_full_name
(
db
->
i
->
env
->
i
->
dir
,
fname
);
printf
(
"Full name = %s
\n
"
,
db
->
i
->
full_fname
);
db
->
i
->
database_name
=
strdup
(
dbname
);
db
->
i
->
database_name
=
strdup
(
dbname
?
dbname
:
""
);
if
(
flags
&
DB_RDONLY
)
openflags
|=
O_RDONLY
;
else
openflags
|=
O_RDWR
;
...
...
@@ -416,6 +426,8 @@ int __toku_db_stat (DB *db, void *v, u_int32_t flags) {
abort
();
}
extern
int
default_compare_fun
(
DB
*
db
,
const
DBT
*
a
,
const
DBT
*
b
);
int
db_create
(
DB
**
db
,
DB_ENV
*
env
,
u_int32_t
flags
)
{
DB
*
result
=
malloc
(
sizeof
(
*
result
));
fprintf
(
stderr
,
"%s:%d db_create(%p, %p, 0x%x)
\n
"
,
__FILE__
,
__LINE__
,
db
,
env
,
flags
);
...
...
@@ -435,7 +447,7 @@ int db_create (DB **db, DB_ENV *env, u_int32_t flags) {
result
->
stat
=
__toku_db_stat
;
result
->
i
=
malloc
(
sizeof
(
*
result
->
i
));
result
->
i
->
freed
=
0
;
result
->
i
->
bt_compare
=
0
;
result
->
i
->
bt_compare
=
default_compare_fun
;
result
->
i
->
header
=
0
;
result
->
i
->
database_number
=
0
;
result
->
i
->
env
=
env
;
...
...
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