12 Commits

Author SHA1 Message Date
Yota Toyama
56de2259dd Merge branch 'main' into feature/tagged-pointer 2023-09-28 17:06:06 +10:00
Yota Toyama
b540c0597c Disable mask 2023-09-28 16:38:58 +10:00
Yota Toyama
10ffdd9351 Set pointer mask 2023-09-28 16:33:49 +10:00
Yota Toyama
0bd260a7c0 Fix spell check 2023-09-28 16:26:53 +10:00
Yota Toyama
6cb47fddd0 Fix 2023-09-28 16:19:16 +10:00
Yota Toyama
039a10213d Fix 2023-09-28 16:08:02 +10:00
Yota Toyama
b204c1a6a2 Fix registration 2023-09-28 16:06:20 +10:00
Yota Toyama
44fff26f2f Set pointer mask 2023-09-28 16:00:06 +10:00
Yota Toyama
ef9675ab17 Merge branch 'main' into feature/tagged-pointer 2023-09-28 15:55:23 +10:00
Yota Toyama
4bf1effc4b Fix test 2023-09-28 15:44:14 +10:00
Yota Toyama
1aaf2fb621 Fix 2023-09-28 15:11:23 +10:00
Yota Toyama
25631ef919 Revert "Remove tagged pointer example"
This reverts commit a318362d25.
2023-09-28 15:04:36 +10:00
10 changed files with 52 additions and 19 deletions

11
.github/mergify.yml vendored Normal file
View File

@@ -0,0 +1,11 @@
pull_request_rules:
- name: dependabot
conditions:
- author=dependabot[bot]
actions:
queue:
name: default
method: squash
queue_rules:
- name: default
conditions: []

View File

@@ -1,13 +0,0 @@
name: dependabot
on: pull_request
permissions:
contents: write
pull-requests: write
jobs:
merge:
runs-on: ubuntu-latest
if: github.actor == 'dependabot[bot]'
steps:
- run: gh pr merge --auto --squash ${{ github.event.pull_request.html_url }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -1,7 +1,7 @@
[package]
name = "bdwgc-alloc"
description = "impl GlobalAlloc for bdwgc"
version = "0.6.8"
version = "0.6.7"
authors = [
"swgillespie <sean.william.g@gmail.com>",
"Yota Toyama <raviqqe@gmail.com>",

View File

@@ -5,4 +5,5 @@ members = [
"free_by_borrow",
"free_by_gc",
"static_threads",
"tagged_pointer",
]

View File

@@ -0,0 +1,9 @@
[package]
name = "tagged_pointer"
version = "0.1.0"
authors = ["Yota Toyama <raviqqe@gmail.com>"]
edition = "2021"
publish = false
[dependencies]
bdwgc-alloc = { path = "../.." }

View File

@@ -0,0 +1,27 @@
use bdwgc_alloc::Allocator;
use std::alloc::{alloc, Layout};
const BITS: usize = usize::MAX << 48 | 0x7;
#[global_allocator]
static GLOBAL_ALLOCATOR: Allocator = Allocator;
fn main() {
unsafe { Allocator::initialize() }
loop {
let x = allocate();
unsafe { *x = 42 };
let x = x as usize | BITS;
assert_eq!(x & BITS, BITS);
Allocator::force_collect();
assert_eq!(unsafe { *((x & !BITS) as *mut usize) }, 42);
}
}
fn allocate() -> *mut usize {
(unsafe { alloc(Layout::from_size_align(1 << 8, 8).unwrap()) }) as *mut usize
}

1
rust-toolchain Normal file
View File

@@ -0,0 +1 @@
stable

View File

@@ -1,3 +0,0 @@
[toolchain]
channel = "stable"
components = ["clippy", "rustfmt", "rust-analyzer", "rust-src"]

2
vendor/bdwgc vendored