linear_memory 1.0.2

  • Readme
  • Changelog
  • Example
  • Installing
  • 0

linear_memory #

Efficiently manages distribution of linear memory. Useful for compilers, etc.

Check out test/all_test.dart.

1.0.2 #

  • LinearMemory.grow now occurs in place.


import 'package:linear_memory/linear_memory.dart';
import 'package:test/test.dart';

main() {
  var memory = new LinearMemory(10);

  // Mark a continuous number of bytes as in use.
  var block = memory.allocate(4);
  expect(block.offset, 0);
  expect(block.size, 4);

  // Returns `null` is the requested memory is out-of-bounds.
  var exceedsBounds = memory.allocate(7);
  expect(exceedsBounds, isNull);

  // A memory unit can grow in place.

  // Memory units are generic, and each block can have a value.
  var buffers = new LinearMemory<double>(250);
  var twentyFour = buffers.allocate(45, 24.0);

  // The offset of each memory block is statically computed.

  // Blocks can grow in size.

  // Blocks can be released.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  linear_memory: ^1.0.2

2. Install it

You can install packages from the command line:

with pub:

$ pub get

Alternatively, your editor might support pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:linear_memory/linear_memory.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

The package version is not analyzed, because it does not support Dart 2. Until this is resolved, the package will receive a health and maintenance score of 0.

Analysis issues and suggestions

Support Dart 2 in pubspec.yaml.

The SDK constraint in pubspec.yaml doesn't allow the Dart 2.0.0 release. For information about upgrading it to be Dart 2 compatible, please see


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.19.0 <=3.0.0