Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
R
rust-rocksdb
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fangzongwu
rust-rocksdb
Commits
2dc9568b
Commit
2dc9568b
authored
Feb 12, 2016
by
Tyler Neely
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #45 from petevine/master
Fix compilation on ARM for Rust >= 1.6
parents
0f3a6891
83c055d4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
ffi.rs
src/ffi.rs
+1
-1
rocksdb.rs
src/rocksdb.rs
+7
-7
No files found.
src/ffi.rs
View file @
2dc9568b
...
...
@@ -90,7 +90,7 @@ pub enum DBUniversalCompactionStyle {
}
pub
fn
error_message
(
ptr
:
*
const
i8
)
->
String
{
let
c_str
=
unsafe
{
CStr
::
from_ptr
(
ptr
)
};
let
c_str
=
unsafe
{
CStr
::
from_ptr
(
ptr
as
*
const
_
)
};
let
s
=
from_utf8
(
c_str
.to_bytes
())
.unwrap
()
.to_owned
();
unsafe
{
libc
::
free
(
ptr
as
*
mut
libc
::
c_void
);
...
...
src/rocksdb.rs
View file @
2dc9568b
...
...
@@ -264,7 +264,7 @@ impl DB {
if
cfs
.len
()
==
0
{
unsafe
{
db
=
rocksdb_ffi
::
rocksdb_open
(
opts
.inner
,
cpath_ptr
,
err_ptr
);
db
=
rocksdb_ffi
::
rocksdb_open
(
opts
.inner
,
cpath_ptr
as
*
const
_
,
err_ptr
);
}
}
else
{
let
mut
cfs_v
=
cfs
.to_vec
();
...
...
@@ -282,7 +282,7 @@ impl DB {
})
.collect
();
let
cfnames
:
Vec
<*
const
i8
>
=
c_cfs
.iter
()
let
cfnames
:
Vec
<*
const
_
>
=
c_cfs
.iter
()
.map
(|
cf
|
cf
.as_ptr
())
.collect
();
...
...
@@ -303,9 +303,9 @@ impl DB {
let
handles
:
*
const
rocksdb_ffi
::
DBCFHandle
=
cfhandles
.as_ptr
();
let
nfam
=
cfs_v
.len
();
unsafe
{
db
=
rocksdb_ffi
::
rocksdb_open_column_families
(
opts
.inner
,
cpath_ptr
,
db
=
rocksdb_ffi
::
rocksdb_open_column_families
(
opts
.inner
,
cpath_ptr
as
*
const
_
,
nfam
as
libc
::
c_int
,
cfnames
.as_ptr
(),
cfnames
.as_ptr
()
as
*
const
_
,
copts
,
handles
,
err_ptr
);
}
...
...
@@ -342,7 +342,7 @@ impl DB {
let
mut
err
:
*
const
i8
=
0
as
*
const
i8
;
let
err_ptr
:
*
mut
*
const
i8
=
&
mut
err
;
unsafe
{
rocksdb_ffi
::
rocksdb_destroy_db
(
opts
.inner
,
cpath_ptr
,
err_ptr
);
rocksdb_ffi
::
rocksdb_destroy_db
(
opts
.inner
,
cpath_ptr
as
*
const
_
,
err_ptr
);
}
if
!
err
.is_null
()
{
return
Err
(
error_message
(
err
));
...
...
@@ -358,7 +358,7 @@ impl DB {
let
mut
err
:
*
const
i8
=
0
as
*
const
i8
;
let
err_ptr
:
*
mut
*
const
i8
=
&
mut
err
;
unsafe
{
rocksdb_ffi
::
rocksdb_repair_db
(
opts
.inner
,
cpath_ptr
,
err_ptr
);
rocksdb_ffi
::
rocksdb_repair_db
(
opts
.inner
,
cpath_ptr
as
*
const
_
,
err_ptr
);
}
if
!
err
.is_null
()
{
return
Err
(
error_message
(
err
));
...
...
@@ -474,7 +474,7 @@ impl DB {
let
cf_handler
=
rocksdb_ffi
::
rocksdb_create_column_family
(
self
.inner
,
opts
.inner
,
cname_ptr
,
cname_ptr
as
*
const
_
,
err_ptr
);
self
.cfs
.insert
(
name
.to_string
(),
cf_handler
);
cf_handler
...
...
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