Skip to content

Commit

Permalink
mmap-alloc: Add large-align feature, support committing on Linux/Mac
Browse files Browse the repository at this point in the history
- Add large-align feature, allowing alignments larger than a page
  size
- Allow memory to be explicitly committed on Linux and Mac
- Allow memory to be committed on allocation on Mac
- Improve documentation around committed/uncommitted memory
- Closes #151
  • Loading branch information
joshlf committed Mar 16, 2018
1 parent 410bec8 commit a4b1ea4
Show file tree
Hide file tree
Showing 6 changed files with 258 additions and 87 deletions.
7 changes: 7 additions & 0 deletions mmap-alloc/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,16 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).

## [Unreleased]

### Added
- Added support for committing on Linux and Mac
- Added support for configuring commit on allocation on Mac
- Added support for alignments larger than a memory page (`large-align`
feature)

### Changed
- Upgraded to new `UntypedObjectAlloc` trait that uses `NonNull<u8>` instead
of `*mut u8`
- Improved documentation on committed vs. uncommitted memory

## 0.2.0

Expand Down
5 changes: 5 additions & 0 deletions mmap-alloc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ repository = "https://github.com/ezrosent/allocators-rs/tree/master/mmap-alloc"

exclude = ["appveyor.sh", "travis.sh"]

[features]
# Support alignments larger than a page size by mapping a larger region
# and then unmapping all but a properly-aligned subset of the region.
large-align = []

[dependencies]
errno = "0.2"
kernel32-sys = "0.2"
Expand Down
6 changes: 4 additions & 2 deletions mmap-alloc/appveyor.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

# Copyright 2017 the authors. See the 'Copyright and license' section of the
# Copyright 2017-2018 the authors. See the 'Copyright and license' section of the
# README.md file at the top-level directory of this repository.
#
# Licensed under the Apache License, Version 2.0 (the LICENSE-APACHE file) or
Expand All @@ -17,4 +17,6 @@ fi
export RUST_TEST_THREADS=1

cargo build
RUST_BACKTRACE=1 cargo test
for feature in '' large-align; do
RUST_BACKTRACE=1 cargo test --features "$feature"
done
Loading

0 comments on commit a4b1ea4

Please sign in to comment.