File tree 1 file changed +6
-6
lines changed
1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change 22
22
use std::mem;
23
23
24
24
impl<T> Vec<T> {
25
- fn new() -> Self {
25
+ pub fn new() -> Self {
26
26
assert!(mem::size_of::<T>() != 0, "We're not ready to handle ZSTs");
27
27
Vec {
28
28
ptr: NonNull::dangling(),
@@ -39,11 +39,11 @@ I slipped in that assert there because zero-sized types will require some
39
39
special handling throughout our code, and I want to defer the issue for now.
40
40
Without this assert, some of our early drafts will do some Very Bad Things.
41
41
42
- Next we need to figure out what to actually do when we * do* want space. For that,
43
- we use the global allocation functions [ ` alloc ` ] [ alloc ] , [ ` realloc ` ] [ realloc ] ,
44
- and [ ` dealloc ` ] [ dealloc ] which are available in stable Rust in
45
- [ ` std::alloc ` ] [ std_alloc ] . These functions are expected to become deprecated in
46
- favor of the methods of [ ` std::alloc::Global ` ] [ Global ] after this type is stabilized.
42
+ Next we need to figure out what to actually do when we * do* want space. For that,
43
+ we use the global allocation functions [ ` alloc ` ] [ alloc ] , [ ` realloc ` ] [ realloc ] ,
44
+ and [ ` dealloc ` ] [ dealloc ] which are available in stable Rust in
45
+ [ ` std::alloc ` ] [ std_alloc ] . These functions are expected to become deprecated in
46
+ favor of the methods of [ ` std::alloc::Global ` ] [ Global ] after this type is stabilized.
47
47
48
48
We'll also need a way to handle out-of-memory (OOM) conditions. The standard
49
49
library provides a function [ ` alloc::handle_alloc_error ` ] [ handle_alloc_error ] ,
You can’t perform that action at this time.
0 commit comments