Skip to content

Commit 132dadb

Browse files
sam-mccallcopybara-github
authored andcommitted
crubit: introduce default cc_std global allocator
PiperOrigin-RevId: 872597117
1 parent 1899951 commit 132dadb

File tree

2 files changed

+0
-24
lines changed

2 files changed

+0
-24
lines changed

support/cc_std_impl/cpp_std_allocator.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@ use core::alloc::Layout;
1111
use core::ffi::c_void;
1212
use core::ptr::NonNull;
1313

14-
#[global_allocator]
15-
static ALLOCATOR: StdAllocator = StdAllocator {};
16-
1714
pub struct StdAllocator {}
1815

1916
unsafe impl Allocator for StdAllocator {

support/cc_std_impl/test/unique_ptr/unique_ptr_test.rs

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// Exceptions. See /LICENSE for license information.
33
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
44

5-
use cc_std::std::unique_ptr;
65
use googletest::prelude::*;
76
use std::sync::atomic::{AtomicI32, Ordering};
87

@@ -120,26 +119,6 @@ fn test_unique_ptr_destroyed_in_cpp() {
120119
test_helpers::unique_ptr_test::destroy_unique_ptr(up);
121120
}
122121

123-
#[gtest]
124-
fn test_box_to_unique_ptr() {
125-
let b = Box::new(InstanceCounted::new());
126-
let ptr = Box::into_raw(b);
127-
let up = unsafe { unique_ptr::new(ptr) };
128-
assert_eq!(INSTANCE_COUNTER.load(Ordering::Acquire), 1);
129-
drop(up);
130-
assert_eq!(INSTANCE_COUNTER.load(Ordering::Acquire), 0);
131-
}
132-
133-
#[gtest]
134-
fn test_unique_ptr_to_box() {
135-
let mut up = InstanceCounted::new_unique_ptr();
136-
let ptr = up.release();
137-
let b = unsafe { Box::from_raw(ptr) };
138-
assert_eq!(INSTANCE_COUNTER.load(Ordering::Acquire), 1);
139-
drop(b);
140-
assert_eq!(INSTANCE_COUNTER.load(Ordering::Acquire), 0);
141-
}
142-
143122
#[gtest]
144123
fn test_unique_ptr_with_virtual_destructor() {
145124
let mut p = test_helpers::unique_ptr_test::create_virtual_base();

0 commit comments

Comments
 (0)