Skip to content

Commit a647f02

Browse files
committed
simplicity and simplicity-sys: bump major versions
In another PR I add a regression test against the released 0.3.0 version of rust-simplicity. It breaks some tooling to have two 0.3.0s in play at once -- one from this repo and one from crates.io. Take this opportunity to bump versions to 0.4.0 to avoid this conflict. Once we get this into a reasonable bug-free state we should do another release.
1 parent d7acf7d commit a647f02

File tree

8 files changed

+27
-27
lines changed

8 files changed

+27
-27
lines changed

Cargo-recent.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ dependencies = [
433433

434434
[[package]]
435435
name = "simplicity-lang"
436-
version = "0.3.0"
436+
version = "0.4.0"
437437
dependencies = [
438438
"bitcoin",
439439
"bitcoin_hashes",
@@ -449,7 +449,7 @@ dependencies = [
449449

450450
[[package]]
451451
name = "simplicity-sys"
452-
version = "0.3.0"
452+
version = "0.4.0"
453453
dependencies = [
454454
"bitcoin_hashes",
455455
"cc",

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "simplicity-lang"
3-
version = "0.3.0"
3+
version = "0.4.0"
44
authors = ["Andrew Poelstra <apoelstra@wpsoftware.net>"]
55
license = "CC0-1.0"
66
homepage = "https://github.com/BlockstreamResearch/rust-simplicity/"
@@ -28,14 +28,14 @@ elements = { version = "0.25.0", optional = true, default-features = false }
2828
hashes = { package = "bitcoin_hashes", version = "0.14" }
2929
hex = { package = "hex-conservative", version = "0.1.1" }
3030
santiago = "1.3"
31-
simplicity-sys = { version = "0.3.0", path = "./simplicity-sys" }
31+
simplicity-sys = { version = "0.4.0", path = "./simplicity-sys" }
3232
serde = { version = "1.0.103", features = ["derive"], optional = true }
3333

3434
[target.wasm32-unknown-unknown.dependencies]
3535
getrandom = { version = "0.2", features = ["js"] }
3636

3737
[dev-dependencies]
38-
simplicity-sys = { version = "0.3.0", path = "./simplicity-sys", features = [
38+
simplicity-sys = { version = "0.4.0", path = "./simplicity-sys", features = [
3939
"test-utils",
4040
] }
4141

simpcli/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ edition = "2018"
88
[dependencies]
99
base64 = "0.21"
1010
# todo add lexopt for command line parsing
11-
simplicity-lang = { version = "0.3", path = "..", features = [ "serde", "elements" ] }
11+
simplicity-lang = { version = "0.4", path = "..", features = [ "serde", "elements" ] }
1212

1313
[[bin]]
1414
name = "simpcli"

simplicity-sys/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "simplicity-sys"
3-
version = "0.3.0"
3+
version = "0.4.0"
44
license = "CC0-1.0"
55
homepage = "https://github.com/BlockstreamResearch/rust-simplicity/"
66
repository = "https://github.com/BlockstreamResearch/rust-simplicity/"

simplicity-sys/depend/simplicity/simplicity_alloc.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@
66
/* Declare Rust functions so the compiler can handle them.
77
* The linker will include the functions from Rust.
88
*/
9-
extern void* rust_0_3_malloc(size_t size);
10-
extern void* rust_0_3_calloc(size_t num, size_t size);
11-
extern void rust_0_3_free(void* ptr);
9+
extern void* rust_0_4_malloc(size_t size);
10+
extern void* rust_0_4_calloc(size_t num, size_t size);
11+
extern void rust_0_4_free(void* ptr);
1212

13-
/* Allocate with rust_0_3_malloc. */
14-
#define simplicity_malloc rust_0_3_malloc
13+
/* Allocate with rust_0_4_malloc. */
14+
#define simplicity_malloc rust_0_4_malloc
1515

16-
/* Allocate+zero initialize with rust_0_3_calloc. */
17-
#define simplicity_calloc rust_0_3_calloc
16+
/* Allocate+zero initialize with rust_0_4_calloc. */
17+
#define simplicity_calloc rust_0_4_calloc
1818

19-
/* Deallocate with rust_0_3_free. */
20-
#define simplicity_free rust_0_3_free
19+
/* Deallocate with rust_0_4_free. */
20+
#define simplicity_free rust_0_4_free
2121

2222
#endif /* SIMPLICITY_SIMPLICITY_ALLOC_H */

simplicity-sys/src/alloc.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ type AllocatorFn = unsafe fn(Layout) -> *mut u8;
2828
/// # Safety
2929
///
3030
/// - `allocator` must be [`alloc::alloc`] or [`alloc::alloc_zeroed`].
31-
/// - Allocated bytes must be freed using [`rust_0_3_free`].
31+
/// - Allocated bytes must be freed using [`rust_0_4_free`].
3232
unsafe fn allocate(size_bytes: usize, allocator: AllocatorFn) -> *mut u8 {
3333
assert!(mem::align_of::<usize>() <= MIN_ALIGN);
3434
assert!(mem::align_of::<&usize>() <= MIN_ALIGN);
@@ -73,9 +73,9 @@ unsafe fn allocate(size_bytes: usize, allocator: AllocatorFn) -> *mut u8 {
7373
///
7474
/// # Safety
7575
///
76-
/// Allocated bytes must be freed using [`rust_0_3_free`].
76+
/// Allocated bytes must be freed using [`rust_0_4_free`].
7777
#[no_mangle]
78-
pub unsafe extern "C" fn rust_0_3_malloc(size_bytes: usize) -> *mut u8 {
78+
pub unsafe extern "C" fn rust_0_4_malloc(size_bytes: usize) -> *mut u8 {
7979
// SAFETY: Allocator is `alloc::alloc`.
8080
allocate(size_bytes, alloc::alloc)
8181
}
@@ -84,9 +84,9 @@ pub unsafe extern "C" fn rust_0_3_malloc(size_bytes: usize) -> *mut u8 {
8484
///
8585
/// # Safety
8686
///
87-
/// Allocated bytes must be freed using [`rust_0_3_free`].
87+
/// Allocated bytes must be freed using [`rust_0_4_free`].
8888
#[no_mangle]
89-
pub unsafe extern "C" fn rust_0_3_calloc(num: usize, size: usize) -> *mut u8 {
89+
pub unsafe extern "C" fn rust_0_4_calloc(num: usize, size: usize) -> *mut u8 {
9090
let size_bytes = num * size;
9191
// SAFETY: Allocator is `alloc_alloc_zeroed`.
9292
allocate(size_bytes, alloc::alloc_zeroed)
@@ -96,15 +96,15 @@ pub unsafe extern "C" fn rust_0_3_calloc(num: usize, size: usize) -> *mut u8 {
9696
///
9797
/// # Safety
9898
///
99-
/// - `ptr_bytes` must have been allocated using [`rust_0_3_malloc`] or [`rust_0_3_calloc`].
99+
/// - `ptr_bytes` must have been allocated using [`rust_0_4_malloc`] or [`rust_0_4_calloc`].
100100
/// - If `ptr_bytes` is a `NULL` pointer, then this function is a NO-OP.
101101
#[no_mangle]
102-
pub unsafe extern "C" fn rust_0_3_free(ptr_bytes: *mut u8) {
102+
pub unsafe extern "C" fn rust_0_4_free(ptr_bytes: *mut u8) {
103103
if ptr_bytes.is_null() {
104104
return;
105105
}
106106

107-
// We got a pointer to an allocation from `rust_0_3_malloc` or `rust_0_3_calloc`,
107+
// We got a pointer to an allocation from `rust_0_4_malloc` or `rust_0_4_calloc`,
108108
// so the memory looks as follows.
109109
// There is a prefix of `MIN_ALIGN` bytes in front of the pointer we got.
110110
// This prefix holds the total number of allocated bytes.

simplicity-sys/src/c_jets/c_env.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,8 @@ impl CElementsTxEnv {
210210
impl Drop for CElementsTxEnv {
211211
fn drop(&mut self) {
212212
unsafe {
213-
crate::alloc::rust_0_3_free(self.tx as *mut u8);
214-
crate::alloc::rust_0_3_free(self.taproot as *mut u8);
213+
crate::alloc::rust_0_4_free(self.tx as *mut u8);
214+
crate::alloc::rust_0_4_free(self.taproot as *mut u8);
215215
}
216216
}
217217
}

simplicity-sys/src/tests/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ struct FreeOnDrop(*mut u8);
102102
impl Drop for FreeOnDrop {
103103
fn drop(&mut self) {
104104
unsafe {
105-
crate::alloc::rust_0_3_free(self.0);
105+
crate::alloc::rust_0_4_free(self.0);
106106
}
107107
}
108108
}

0 commit comments

Comments
 (0)