linear_memory 1.0.2

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 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.

example/main.dart

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.grow(32);

  // 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.
  print(twentyFour.offset);

  // Blocks can grow in size.
  twentyFour.grow(150);

  // Blocks can be released.
  twentyFour.release();
}

Use this package as a library

1. Depend on it

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


dependencies:
  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';
  
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
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
--
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
--
Overall:
Weighted score of the above. [more]
0
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 https://www.dartlang.org/dart-2#migration.

Maintenance issues and suggestions

Make sure dartdoc successfully runs on your package's source files. (-10 points)

Dependencies were not resolved.

Dependencies

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