Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move protection #488

Merged
merged 111 commits into from
Aug 12, 2024
Merged
Changes from 1 commit
Commits
Show all changes
111 commits
Select commit Hold shift + click to select a range
9841d45
macro generation
milyin Jun 30, 2024
2b2b0d1
moved types added to decl
milyin Jun 30, 2024
c0fe84e
moved type drop
milyin Jun 30, 2024
2197cad
switched rust to z_moved
milyin Jun 30, 2024
4ce12e5
moved closures
milyin Jun 30, 2024
b19de8d
build macros fixed
milyin Jun 30, 2024
25d2c96
z_move name restored
milyin Jun 30, 2024
a27ea46
into_rust_type for moved, payloads
milyin Jun 30, 2024
fc54e00
tests updated
milyin Jun 30, 2024
26b6555
cargo fmt
milyin Jul 1, 2024
6a1b03c
moved structs in some drops/undeclares
milyin Jul 1, 2024
aa087ab
moved as separate parameter
milyin Jul 2, 2024
7ffc28f
removed asref from moved
milyin Jul 2, 2024
b8e5c95
moved unfinished
milyin Jul 2, 2024
1ac56fa
moved type with into_rust_type trait, comiles without shm
milyin Jul 3, 2024
2755e80
build with shm passed
milyin Jul 3, 2024
9be5468
option added to some decl_c_type
milyin Jul 3, 2024
b26d929
clippy fix
milyin Jul 3, 2024
91a7cce
Merge branch 'dev/1.0.0' into move_protection2
milyin Jul 3, 2024
036518c
build fix
milyin Jul 3, 2024
eef474a
moved types added
milyin Jul 3, 2024
da0e172
task moved used
milyin Jul 3, 2024
51b51cb
some examples fixes
milyin Jul 4, 2024
52f07dd
Merge branch 'dev/1.0.0' into move_protection2
milyin Jul 4, 2024
c83f304
macros corrected to use auto derive loaned type from owned feature
milyin Jul 4, 2024
d3c36b7
optional comma allowed in macros where forgotten
milyin Jul 4, 2024
ad606ee
property moved get
milyin Jul 4, 2024
f9cf7db
put options move
milyin Jul 4, 2024
910534a
publisher delete options made simpler
milyin Jul 4, 2024
1901504
put options with moved
milyin Jul 4, 2024
949c033
delete options timestamp simplified
milyin Jul 4, 2024
a1a506d
more moved in options, timestamp simplified
milyin Jul 4, 2024
384606c
examples,tests updated
milyin Jul 4, 2024
697e769
tests compile fixes
milyin Jul 5, 2024
3656761
fix for test failure due to calling z_moved_xxx_t destructor on uniti…
milyin Jul 5, 2024
6c2c5b1
cargo fmt imports
milyin Jul 5, 2024
b302209
Merge branch 'dev/1.0.0' into move_protection2
milyin Jul 5, 2024
d32dc16
build fixes
milyin Jul 5, 2024
9555c54
Merge branch 'dev/1.0.0' into move_protection2
milyin Jul 28, 2024
f466f2a
some xompile errors fixed
milyin Jul 28, 2024
ce2de57
some build errors fixed
milyin Jul 28, 2024
bb71c4a
some build errors fixed
milyin Jul 28, 2024
4fe741e
build fixes
milyin Jul 28, 2024
a4de03c
cargo fmt
milyin Jul 28, 2024
d533dc8
into_rust_type usage fixes
milyin Jul 28, 2024
eb5839d
encoding drop fixed
milyin Jul 28, 2024
c5baf3d
restored headers
milyin Jul 28, 2024
51aa6a8
zcu renamed back to zc
milyin Jul 28, 2024
c99f1ed
zcu renamed back to zc
milyin Jul 28, 2024
485c885
z_xxx_move is static inline, cpp fixes
milyin Jul 29, 2024
f69ec33
clang format from start
milyin Jul 30, 2024
a5a8802
cargo fmt
milyin Jul 30, 2024
9c09c0b
Merge branch 'dev/1.0.0' into move_protection2
milyin Jul 30, 2024
6176248
macros contains funcions now, it needs types defined
milyin Jul 30, 2024
f8d2a1f
removed zenoh_macros include
milyin Jul 30, 2024
5c55758
zenoh_macros include returned back to place
milyin Jul 30, 2024
a812196
C++ build test added, fails for now
milyin Jul 30, 2024
90a45e9
C++ enabling correction
milyin Jul 30, 2024
ed5d9d7
C++ compilation for tests added
milyin Jul 31, 2024
60c01da
C++ build test
milyin Aug 1, 2024
90bb511
cargo lock update
milyin Aug 1, 2024
2920868
retrun value if not void from template functions
milyin Aug 1, 2024
1cf9569
Merge branch 'dev/1.0.0' into move_protection2
milyin Aug 1, 2024
15cf196
cargo fmt
milyin Aug 1, 2024
82f9233
build fixes
milyin Aug 1, 2024
bae3273
build fix after cargo.lock update
milyin Aug 1, 2024
4ab1965
Merge branch 'global_client_sroage_build_fix' into move_protection2
milyin Aug 1, 2024
ec153b6
moved types for buffer creation functions
milyin Aug 2, 2024
9014d82
clippy fix
milyin Aug 2, 2024
933daa1
clippy fix: c_char can be i8 or u8 depending on platform
milyin Aug 2, 2024
2428236
headers restored
milyin Aug 2, 2024
5bc1ca6
cargo fmt
milyin Aug 2, 2024
7a1d734
-c c++ flag for clang only
milyin Aug 2, 2024
ac5b6d6
c++ build fix - brackets removed
milyin Aug 2, 2024
5562413
type specific take functions added, _ptr in moved
milyin Aug 3, 2024
fa799c5
generic_take_cpp
milyin Aug 3, 2024
7f15915
z_take impls at the end
milyin Aug 3, 2024
165e81b
take funcs before generics
milyin Aug 3, 2024
05de856
take moved after null
milyin Aug 3, 2024
2e66048
names fix
milyin Aug 3, 2024
5172aae
missing null functioj added
milyin Aug 3, 2024
6ad18e7
tests fixed for c++
milyin Aug 3, 2024
d5d5775
explicit null calls
milyin Aug 4, 2024
8957e5f
fix generic parameter names c compilation
milyin Aug 4, 2024
47e7c15
null call fix
milyin Aug 4, 2024
5189daa
misprint fixed
milyin Aug 4, 2024
016ae13
return removed
milyin Aug 4, 2024
a4e5e37
Rename `close` to `undeclare` for Publication Cache and Querying Subs…
fuzzypixelz Aug 1, 2024
5cb9e26
Temporarily use original pull request branch
fuzzypixelz Aug 1, 2024
cda429f
Update to eclipse-zenoh/zenoh@ce4e9bf
fuzzypixelz Aug 2, 2024
700b522
Fix `z_ref_shm_client_storage_global`
fuzzypixelz Aug 2, 2024
c8ee1ea
Update Cargo.toml
Mallets Aug 2, 2024
d46e38d
Merge branch 'dev/1.0.0' into move_protection2
milyin Aug 4, 2024
1570cde
Merge branch 'dev/1.0.0' into move_protection2
milyin Aug 5, 2024
5324718
Merge branch 'dev/1.0.0' into move_protection2
milyin Aug 6, 2024
f5cb326
Merge branch 'dev/1.0.0' into move_protection2
milyin Aug 8, 2024
68e7e81
build fixes
milyin Aug 8, 2024
5c4367e
zc_ prefix for log function
milyin Aug 8, 2024
447110c
zc_ prefix in example
milyin Aug 8, 2024
34269da
Merge branch 'dev/1.0.0' into move_protection2
milyin Aug 8, 2024
37aeafe
regenerated files
milyin Aug 8, 2024
2d12a70
cargo fmt
milyin Aug 8, 2024
fcf51d4
undeclare as drop
milyin Aug 8, 2024
a286ec8
removed _undeclare parsing
milyin Aug 9, 2024
68aaf50
missing drop/check funcs added. verification added to build.rs
milyin Aug 9, 2024
b0ce23a
cargo fmt
milyin Aug 9, 2024
03a3790
tests fix
milyin Aug 9, 2024
a97c3af
test fix
milyin Aug 9, 2024
da66687
Merge branch 'dev/1.0.0' into move_protection2
milyin Aug 9, 2024
a705e11
cmake fix
milyin Aug 9, 2024
dc03266
null drop test same as in pico, take corrected
milyin Aug 10, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 18 additions & 5 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1058,11 +1058,18 @@ pub fn make_move_take_signatures(
path_in: &str,
) -> (Vec<FunctionSignature>, Vec<FunctionSignature>) {
let bindings = std::fs::read_to_string(path_in).unwrap();
let re = Regex::new(r"(\w+)_drop\(struct (\w+) (\w+)\);").unwrap();
let re = Regex::new(r"(\w+)(_drop|_undeclare)\(struct (\w+) (\w+)\);").unwrap();
milyin marked this conversation as resolved.
Show resolved Hide resolved
let mut move_funcs = Vec::<FunctionSignature>::new();
let mut take_funcs = Vec::<FunctionSignature>::new();
let mut processed = HashSet::<String>::new();

for (_, [func_name, arg_type, arg_name]) in re.captures_iter(&bindings).map(|c| c.extract()) {
for (_, [func_name, _, arg_type, arg_name]) in re.captures_iter(&bindings).map(|c| c.extract())
{
if processed.contains(arg_type) {
continue;
} else {
processed.insert(arg_type.to_string());
}
let (prefix, _, semantic, postfix) = split_type_name(arg_type);
let z_owned_type = format!("{}_{}_{}_{}*", prefix, "owned", semantic, postfix);
let z_moved_type = format!("{}_{}_{}_{}", prefix, "moved", semantic, postfix);
Expand Down Expand Up @@ -1126,12 +1133,18 @@ pub fn find_loan_mut_functions(path_in: &str) -> Vec<FunctionSignature> {

pub fn find_drop_functions(path_in: &str) -> Vec<FunctionSignature> {
let bindings = std::fs::read_to_string(path_in).unwrap();
let re = Regex::new(r"(.+?) +(\w+)_drop\(struct (\w+) (\w+)\);").unwrap();
let re = Regex::new(r"(.+?) +(\w+)(_drop|_undeclare)\(struct (\w+) (\w+)\);").unwrap();
let mut res = Vec::<FunctionSignature>::new();
let mut processed = HashSet::<String>::new();

for (_, [return_type, func_name, arg_type, arg_name]) in
for (_, [return_type, func_name, func_postfix, arg_type, arg_name]) in
re.captures_iter(&bindings).map(|c| c.extract())
{
if processed.contains(arg_type) {
continue;
} else {
processed.insert(arg_type.to_string());
}
// if necessary, other prefixes like "extern", "static", etc. can be removed here
let return_type = return_type
.split(' ')
Expand All @@ -1140,7 +1153,7 @@ pub fn find_drop_functions(path_in: &str) -> Vec<FunctionSignature> {
.join(" ");
let f = FunctionSignature {
return_type: Ctype::new(return_type.as_str()),
func_name: func_name.to_string() + "_drop",
func_name: func_name.to_string() + func_postfix,
args: vec![FuncArg::new(arg_type, arg_name)],
};
res.push(f);
Expand Down
Loading