Skip to content

Commit

Permalink
Prep release
Browse files Browse the repository at this point in the history
  • Loading branch information
jguhlin committed Jan 6, 2025
1 parent eb76878 commit cb26e8f
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 35 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
### 0.1.23 minimap2 2.28
+ Functions to set flag opts for MapOpt and IdxOpt @dwpeng
+ Fixed memory leak when not dropping mm_idx_t properly. This is done by adding in syntactic sugar in minimap2-sys @jguhlin

### 0.1.22 minimap2 2.28
#### Changes
+ Fixed a memory segfault when re-using a thread local buffer. Not sure why it occurs, but this fix seems to solve it.

### 0.1.21 minimap2 2.28
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ minimap2-sys is the raw FFI bindings to minimap2. minimap2 is the more opinionat
# How to use
## Requirements
```toml
minimap2 = "0.1.22+minimap2.2.28"
minimap2 = "0.1.23+minimap2.2.28"
```
Also see [Features](#features)

Expand Down Expand Up @@ -274,6 +274,8 @@ See [customization](#customization) for how to use these.

## Mapping Flags (`MM_F_*`)

These can be set with helper functions. Please see the docs for IdxOpt and MapOpt.

| Flag Constant | Value | Description |
|-------------------------|----------------|-----------------------------------------------------------------|
| `MM_F_NO_DIAG` | `1` | Skip seed pairs on the same diagonal. |
Expand Down Expand Up @@ -328,6 +330,8 @@ See [customization](#customization) for how to use these.

## Indexing Flags (`MM_I_*`)

These can be set with helper functions. Please see the docs for IdxOpt and MapOpt.

| Flag Constant | Value | Description |
|-------------------|--------|----------------------------------------------------------|
| `MM_I_HPC` | `1` | Use homopolymer-compressed k-mers for indexing. |
Expand Down
47 changes: 27 additions & 20 deletions minimap2-sys/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion minimap2-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ pkg-config = "0.3"

[build-dependencies.bindgen]
optional = true
version = "0.70"
version = "0.71"
default-features = false
features = ["which-rustfmt", "runtime"]

Expand Down
5 changes: 3 additions & 2 deletions minimap2-sys/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Use this if you need lower-level bindings for minimap2.
Minimap2 2.28

## Breaking Changes
### 0.0.18
### 0.1.18
mm2-fast and minimap2 have diverged. At this point mm2-fast is no longer supported. Please use a previous crate version.

## Features
Expand All @@ -20,7 +20,8 @@ mm2-fast and minimap2 have diverged. At this point mm2-fast is no longer support

## Changelog
### 0.1.21 minimap2.2.28
Syntactic sugar for mm_idx_t to support Drop, Deref, and DerefMut
* Flag functions for IdxOpt and MapOpt @dwpeng
* Syntactic sugar for mm_idx_t to support Drop, Deref, and DerefMut

### 0.1.20 minimap2.2.28
* Move Drop impl to -sys crate
Expand Down
19 changes: 9 additions & 10 deletions minimap2-sys/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,15 @@ impl Default for mm_mapopt_t {
}
}

impl Default for mm_idxopt_t {
fn default() -> Self {
unsafe {
let mut opt = MaybeUninit::uninit();
mm_idxopt_init(opt.as_mut_ptr());
opt.assume_init()
}
}
}

macro_rules! add_flag_methods {
($ty:ty, $struct_name:ident, $(($set_name:ident, $unset_name:ident, $flag:expr)),+) => {
Expand Down Expand Up @@ -136,16 +145,6 @@ add_flag_methods!(
(set_no_name, unset_no_name, MM_I_NO_NAME)
);

impl Default for mm_idxopt_t {
fn default() -> Self {
unsafe {
let mut opt = MaybeUninit::uninit();
mm_idxopt_init(opt.as_mut_ptr());
opt.assume_init()
}
}
}

// TODO: Add more tests!
#[cfg(test)]
mod tests {
Expand Down

0 comments on commit cb26e8f

Please sign in to comment.