0.8.2 release

Backporting a fix for non x86_64 platforms
This commit is contained in:
Paul Masurel
2019-01-23 13:21:31 +09:00
parent 176f67a266
commit e70a45426a
3 changed files with 23 additions and 8 deletions

View File

@@ -1,3 +1,18 @@
Tantivy 0.8.2
=====================
Fixing build for x86_64 platforms. (#496)
No need to update from 0.8.1 if tantivy
is building on your platform.
Tantivy 0.8.1
=====================
Hotfix of #476.
Merge was reflecting deletes before commit was passed.
Thanks @barrotsteindev for reporting the bug.
Tantivy 0.8.0
=====================
*No change in the index format*

View File

@@ -1,6 +1,6 @@
[package]
name = "tantivy"
version = "0.8.0"
version = "0.8.2"
authors = ["Paul Masurel <paul.masurel@gmail.com>"]
license = "MIT"
categories = ["database-implementations", "data-structures"]

View File

@@ -27,22 +27,22 @@ mod archicture_impl {
#[cfg(not(target_arch = "x86_64"))]
mod archicture_impl {
/// Under other architecture, we rely on a mutex.
use std::sync::Mutex;
use std::sync::atomic::Ordering;
/// Under other architecture, we rely on a mutex.
use std::sync::RwLock;
#[derive(Default)]
pub struct AtomicU64Ersatz(Mutex<u64>);
pub struct AtomicU64Ersatz(RwLock<u64>);
impl AtomicU64Ersatz {
pub fn new(first_opstamp: u64) -> AtomicU64Ersatz {
AtomicU64Ersatz(AtomicUsize::new(first_opstamp))
AtomicU64Ersatz(RwLock::new(first_opstamp))
}
pub fn fetch_add(&self, val: u64, _order: Ordering) -> u64 {
let lock = self.0.lock().unwrap();
pub fn fetch_add(&self, incr: u64, _order: Ordering) -> u64 {
let mut lock = self.0.write().unwrap();
let previous_val = *lock;
*lock = previous_val + 1;
*lock = previous_val + incr;
previous_val
}
}