linear_memory 1.0.2

  • Example
  • Installing
  • Versions
  • 59


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

Check out test/all_test.dart.


  • 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

with Flutter:

$ flutter packages get

Alternatively, your editor might support pub get or flutter packages 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';
Version Uploaded Documentation Archive
1.0.2 May 1, 2018 Go to the documentation of linear_memory 1.0.2 Download linear_memory 1.0.2 archive
1.0.1 Nov 6, 2017 Go to the documentation of linear_memory 1.0.1 Download linear_memory 1.0.1 archive
1.0.0 Nov 6, 2017 Go to the documentation of linear_memory 1.0.0 Download linear_memory 1.0.0 archive


We analyzed this package on Jun 19, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0-dev.63.0
  • pana: 0.11.3


Describes how popular the package is relative to other packages. [more]
19 / 100
Code health derived from static analysis. [more]
99 / 100
Reflects how tidy and up-to-date the package is. [more]
100 / 100
Overall score:
Weighted score of the above. [more]
Learn more about scoring.


Detected platforms: Flutter, web, other

No platform restriction found in primary library package:linear_memory/linear_memory.dart.


  • Fix analysis and formatting issues.

    Analysis or formatting checks reported 1 hint.

    Run dartfmt to format lib/linear_memory.dart.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.19.0 <=3.0.0
Dev dependencies
test ^0.12.0