Support for no alloc

Open
#1,049 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
rust
Domain
data, embedded-iot

Research direction

Start by tracing ndarray's feature configuration, the unconditional alloc import, and the definitions of ArrayView2 and allocation-dependent types such as Array2. The change is done when a no-alloc configuration builds for ArrayView2 while alloc-dependent types are excluded; verify with the crate's existing build or test commands.

Written by the indexing model from the issue text.

Description

This may seem like a strange ask, but in the computer vision community we are currently working on trying to develop an abstraction over various color models for images. A very effective way to work with images is to create ArrayView2 for each layer/channel of the image, especially for images which have interpolated components (like YUV420). At least one person (@astraw) in the Rust CV org is working with microcontrollers where alloc is not currently available. Since we are only interested in ArrayView2 specifically, we theoretically should be able to use that without alloc, but currently ndarray unconditionally brings in the alloc crate.

So, the ask is this: if I put in the work and set up a PR, can we add a new alloc feature, where without that feature extern crate alloc; is gated out, and all of the types which require alloc (like Array2) are no longer included? Thanks!

Dominant language
Rust
Stars
4.3k
Forks
391
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from rust-ndarray/ndarray

All issues in rust-ndarray/ndarray

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.