Skip to content

Commit 8f257c9

Browse files
committed
Misc doc updates
1 parent 8946f1f commit 8f257c9

File tree

3 files changed

+9
-11
lines changed

3 files changed

+9
-11
lines changed

docs/src/base.md

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,11 @@ MemoryKind could be replaced with a function that returned `nothing`, or the cor
3939
MemoryView type directly, but it's nicer to dispatch on `::MemoryKind` than on `::Union{Nothing, Type{<:MemoryView}}`.
4040

4141
## Limitations
42-
* Currently, `MemoryView` does not make use of `Core.GenericMemory`'s additional parameters, such as
43-
atomicity or address space.
44-
This may easily be added with a `GenericMemoryView` type, similar to `Memory` / `GenericMemory`.
42+
* Many optimised fast methods for more established types like `Vector` are missing for `MemoryView`.
43+
These are added over time. Please make an issue or a PR as you encounter missing methods.
4544

46-
* I can't figure out how to support reinterpreted arrays.
47-
Any way I can think of doing so will significantly complicate `MemoryView`, which takes away some of
48-
the appeal of this type's simplicity.
49-
It's possible that reinterpreted arrays are so outside Julia's ordinary memory management
50-
that this simply can't be done.
45+
* Currently, `MemoryView` does not make use of `Core.GenericMemory`'s additional parameters, such as atomicity or address space.
46+
This may easily be added with a `GenericMemoryView` type, similar to `Memory` / `GenericMemory`.
5147

5248
* Currently, `String`s are not backed by `Memory` in Julia. Therefore, creating a `MemoryView` of a string
5349
requires heap-allocating a new `Memory` pointing to the existing memory of the string.
@@ -67,7 +63,7 @@ less nicely with the Julia runtime. Also, the existing `GenericMemoryRef` is ess
6763
#### Advantages
6864
* Pointer-based memviews are cheaper to construct, and do not allocate for strings, unlike `Memory`.
6965
Perhaps in the future, strings too will be backed by `Memory`.
70-
* Their interaction with the GC is simpler (as there is no interaction)
66+
* Pointer-based memory views allows interoperability with non-Julia memory like C owned structs easier.
7167

7268
#### Disadvantages
7369
* While some low-level methods using `MemoryView` will just forward to calling external libraries where

docs/src/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ The `MemoryView` type is a useful low-level building block for code that operate
1717
The `MemoryView` type has the following layout:
1818

1919
```julia
20-
struct MemoryView{T, M} <: AbstractVector{T}
20+
struct MemoryView{T, M} <: DenseVector{T}
2121
ref::MemoryRef{T},
2222
len::Int
2323
end
2424
```
2525

26-
The `M` parameter is either `Mutable` or `Immutable`, which are unexported types defined in this package.
26+
The `M` parameter is either `Mutable` or `Immutable`, which are unexported but public types defined in this package.
2727
MemoryViews also provide the following aliases for convenience:
2828

2929
```julia

src/MemoryViews.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ module MemoryViews
33
export MemoryView,
44
ImmutableMemoryView, MutableMemoryView, MemoryKind, IsMemory, NotMemory, inner
55

6+
public Mutable, Immutable
7+
68
"""
79
Unsafe
810

0 commit comments

Comments
 (0)