linear_memory 1.0.2

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 50

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

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
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
50
Learn more about scoring.

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

  • Dart: 2.1.0
  • pana: 0.12.7

Platforms

Detected platforms: Flutter, web, other

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

Health suggestions

Format lib/linear_memory.dart.

Run dartfmt to format lib/linear_memory.dart.

Dependencies

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