637 Commits

Author SHA1 Message Date
Artem Vorotnikov
f79193e77e
Use write! macro 2019-02-06 18:40:34 +03:00
Artem Vorotnikov
9ad16afcd5
Impl conversion from various number types for String 2019-02-06 18:39:49 +03:00
bors[bot]
fa16a1decb Merge #77
77: impl Hash for Vec and String r=japaric a=vorot93

ref #56 

Co-authored-by: Artem Vorotnikov <artem@vorotnikov.me>
2019-02-06 14:09:11 +00:00
bors[bot]
12358c4850 Merge #74
74: Several missing impls for LinearMap r=japaric a=vorot93



Co-authored-by: Artem Vorotnikov <artem@vorotnikov.me>
2019-02-06 13:54:46 +00:00
bors[bot]
b2691ad66a Merge #68
68: impl Clone for all containers r=japaric a=vorot93



Co-authored-by: Artem Vorotnikov <artem@vorotnikov.me>
2019-02-06 13:49:43 +00:00
Artem Vorotnikov
a56a7ce299
impl Hash for Vec and String 2019-02-05 21:36:39 +03:00
Artem Vorotnikov
ae70cbf309
Several missing impls for LinearMap 2019-02-05 21:29:52 +03:00
Artem Vorotnikov
4b09a24573
impl Clone for all containers 2019-02-05 18:19:41 +03:00
bors[bot]
a1e5408d23 Merge #73
73: tweak ci/script.sh to make it easier to run it locally r=japaric a=japaric



Co-authored-by: Jorge Aparicio <jorge@japaric.io>
2019-02-05 09:35:17 +00:00
Jorge Aparicio
3cf3b77e43 tweak ci/script.sh to make it easier to run it locally 2019-02-05 10:34:34 +01:00
bors[bot]
9484db322e Merge #67
67: Implement FromStr for String r=japaric a=vorot93



Co-authored-by: Artem Vorotnikov <artem@vorotnikov.me>
2019-02-05 09:08:26 +00:00
bors[bot]
22b8d0809a Merge #70
70: Implement Debug for `Queue`, `LinearMap` and `BinaryHeap` r=japaric a=XOSplicer


# Description
As pointed out in #56 the `fmt::Debug` implementation for those types is missing.
This PR implements them by passing their respective `Iterator` to the formatter.

# Open Questions
- Should `Debug` also be implemented for `spsc::Consumer` and `spsc::Producer`?
- Should the implementation for `BinaryHeap` respect the priority of the items in the heap?


Co-authored-by: Felix Stegmaier <stegmaier.felix@gmail.com>
2019-02-05 09:02:29 +00:00
bors[bot]
89bf3ecd13 Merge #71
71: remove no longer needded integer_atomics feature r=japaric a=japaric



Co-authored-by: Jorge Aparicio <jorge@japaric.io>
2019-02-05 08:57:47 +00:00
Jorge Aparicio
82fded5155 remove no longer needded integer_atomics feature 2019-02-04 19:23:47 +01:00
Felix Stegmaier
afa4a1f9bd Implement Debug for BinaryHeap 2019-02-02 14:37:23 +01:00
Felix Stegmaier
252ce94d44 Implement Debug for Queue 2019-02-02 14:22:23 +01:00
Felix Stegmaier
e2fcad0d1e Implement Debug for LinearMap 2019-02-02 14:16:10 +01:00
Artem Vorotnikov
8b7802f352
Implement FromStr for String 2019-01-20 17:25:48 +03:00
bors[bot]
93687110b4 Merge #64
64: add comments indicating how compiler fences affect reordering of memory ops r=japaric a=japaric



Co-authored-by: Jorge Aparicio <jorge@japaric.io>
2019-01-05 08:08:21 +00:00
Jorge Aparicio
e1195dff92 add comments indicating how compiler fences affect reordering of memory ops 2019-01-05 02:31:25 +01:00
bors[bot]
6e521fad24 Merge #63
63: spsc::Queue: add single core variant r=japaric a=japaric



Co-authored-by: Jorge Aparicio <jorge@japaric.io>
v0.4.1
2018-12-15 23:57:40 +00:00
Jorge Aparicio
376cdf476a spsc::Queue: add single core variant 2018-12-16 00:57:07 +01:00
bors[bot]
4bd885e36f Merge #61
61: Implement Display for String r=japaric a=birkenfeld



Co-authored-by: Georg Brandl <g.brandl@fz-juelich.de>
2018-11-12 19:30:20 +00:00
Jorge Aparicio
8fce50a92e
Merge pull request #60 from birkenfeld/patch-1
Fix remaining RingBuffer reference in main crate docs
2018-11-12 20:29:35 +01:00
Georg Brandl
ce6a4a2a2b implement Display for String 2018-11-12 19:30:13 +01:00
Georg Brandl
69379fbccc
Fix remaining RingBuffer reference 2018-10-31 16:06:01 +01:00
bors[bot]
f2cad2fc55 Merge #59
59: v0.4.0 r=japaric a=japaric



Co-authored-by: Jorge Aparicio <jorge@japaric.io>
v0.4.0
2018-10-19 18:15:34 +00:00
Jorge Aparicio
5fb323b437 fix copy paste error 2018-10-19 20:15:09 +02:00
Jorge Aparicio
5bd7789bbe update the CHANGELOG 2018-10-19 19:50:02 +02:00
Jorge Aparicio
b47d8d8a5d drop no longer required feature gate 2018-10-19 19:49:20 +02:00
Jorge Aparicio
64a76132da use integer_atomics feature instead of core_intrinsics 2018-10-19 19:48:07 +02:00
Jorge Aparicio
9c89b3ea49 cargo fmt 2018-10-19 19:34:00 +02:00
Jorge Aparicio
f83329cbf4 rename RingBuffer to spsc::Queue 2018-10-19 19:28:57 +02:00
Jorge Aparicio
991e4146e1 remove Uxx from the public interface 2018-10-19 14:13:10 +02:00
Jorge Aparicio
150a99726f remove default features
this makes this crate compile on stable by default

this is a breaking change
2018-10-19 14:13:10 +02:00
Jorge Aparicio
836dba1e3d RingBuffer: use the full capacity of the array
Before, to achieve a capacity of 16 elements RingBuffer used an array of 17
elements under the hood. Now the same can be accomplished with an array of 16
elements.

This simplifies the bounds of RingBuffer but it's technically a breaking change.

This change adds an overhead of 1 cycle to the enqueue and dequeue operations.

This commit also documents that using capacities that are powers of two results
in better performance (modulo operations become shifts). This was not documented
before and due to the mismatch of capacity and array size a RB with capacity of
15 performed better than one with a capacity of 16.
2018-10-19 14:13:05 +02:00
Jorge Aparicio
113252f7d8 v0.3.7 v0.3.7 2018-08-19 11:37:45 +02:00
bors[bot]
9037d97263 Merge #55
55: internally use MaybeUninit r=japaric a=japaric

which has been proposed in rust-lang/rfcs#1892

Co-authored-by: Jorge Aparicio <jorge@japaric.io>
2018-08-19 09:22:56 +00:00
Jorge Aparicio
8baf6ec65e internally use MaybeUninit
which has been proposed in rust-lang/rfcs#1892
2018-08-19 11:22:06 +02:00
Jorge Aparicio
13a20aeda6
Merge pull request #54 from japaric/stable
CI: run tests on stable
2018-08-19 10:56:52 +02:00
Jorge Aparicio
8c37d3b3d0 CI: run tests on stable 2018-08-19 10:46:46 +02:00
bors[bot]
e2fbadfd30 Merge #48
48: move more feature gates behind a Cargo feature r=japaric a=japaric



Co-authored-by: Jorge Aparicio <jorge@japaric.io>
2018-07-14 00:18:32 +00:00
Jorge Aparicio
baacdf7d7c thumbv6 not supported on beta for now 2018-07-13 19:17:59 -05:00
Jorge Aparicio
bb4f32743f test on beta 2018-07-13 19:08:24 -05:00
Jorge Aparicio
63ae080138 move more feature gates behind a Cargo feature 2018-07-13 19:01:48 -05:00
bors[bot]
930b4964e2 Merge #47
47: RingBuffer: put smaller atomic indices behind a Cargo feature r=japaric a=japaric

cc #40

Co-authored-by: Jorge Aparicio <jorge@japaric.io>
2018-07-13 23:54:37 +00:00
Jorge Aparicio
ae808c9a18 seal the Uxx trait 2018-07-13 18:53:48 -05:00
Jorge Aparicio
ddc6842342 RingBuffer: put smaller atomic indices behind a Cargo feature
this let us drop the core_intrinsics feature gate
2018-07-13 18:51:06 -05:00
bors[bot]
f1b58a8d67 Merge #43
43: Put all const functions behind a const-fn feature r=japaric a=XOSplicer

## Purpose
This PR introduces the `const-fn` feature gate, which when enabled makes most `new` methods `const` 
and therefore usable for initializing `static` variables.
The idea was introduced in #40 with the purpose to come closer to targeting stable rust.
`const` functions are currently only available on rust nightly (tracking issue: [const fn tracking issue (RFC 911)](https://github.com/rust-lang/rust/issues/24111)).
In order to target stable rust this feature is made opt-in.

This feature is a **breaking change** as users of the library now need to explicitly enable it by changing their `Cargo.toml`:
```
...
[dependencies]
heapless = { version = "0.4.0", features = ["const-fn"] }
...
```



## Approach
The implementation of the feature mainly consist of the `const_fn!` macro, which takes a function with `const` modifier
and removes the modifier if the feature gate is not activated.
For the `const` functions a test is intoduced that checks if `static` variables can be initialized.
These tests are only active if the feature is active.
I have not found a way to make doc-test depend on a feature. Therefore some doc-tests are adapted, so that no static initialization is necessary.
The `ci/script.sh` is adapted to also tests with the `--all-feature` flag

## Future
When in the future the `const_fn` rust feature becomes stable, this feature gate **might become active by default**.


Closes #41 .

Co-authored-by: Felix <stegmaier.felix@gmail.com>
Co-authored-by: Felix Stegmaier <stegmaier.felix@gmail.com>
Co-authored-by: Felix Stegmaier <felix.stegmaier@hpe.com>
2018-07-13 17:35:29 +00:00
Felix Stegmaier
6c28c8f62a make feature const-fn default 2018-07-13 11:42:10 +02:00