Skip to content

[RFC]: add @stdlib/array/empty #982

Closed
@kgryte

Description

@kgryte

Description

This RFC proposes adding a package to return an array having uninitialized memory.

The API should be similar to @stdlib/array/ones.

For non-generic dtypes, we can use @stdlib/buffer/alloc-unsafe and the reinterpret the underlying ArrayBuffer. If Buffer is not a Uint8Array (i.e., Node.js <3.0.0), we should use @stdlib/array/zeros. The Uint8Array check can be part of a polyfill.

In browser environments, memory should be zero-filled, as returning uninitialized memory is not possible.

For generic dtype, we should return a zero-filled array.

Related Issues

None.

Questions

No.

Other

No.

Checklist

  • I have read and understood the Code of Conduct.
  • Searched for existing issues and pull requests.
  • The issue name begins with RFC:.

Metadata

Metadata

Assignees

Labels

FeatureIssue or pull request for adding a new feature.RFCRequest for comments. Feature requests and proposed changes.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions