Commit 3976e4f
committed
refactor(allocator)!: make
A further step in refactoring `Address` to make it more robust and performant.
Make `Address::from_ptr` an unsafe method, with the safety invariant that the pointer must be non-null. This:
1. Further discourages use of `Address::from_ptr` - `GetAddress::address` or `UnstableAddress::unstable_address` should be used instead.
2. Opens the door to changing `Address`'s inner type from `usize` to `NonZeroUsize`, which will reduce `Option<Address>` from 16 bytes to 8.Address::from_ptr an unsafe method (#16021)1 parent 72660f7 commit 3976e4f
File tree
3 files changed
+306
-299
lines changed- crates
- oxc_allocator/src
- oxc_traverse
- scripts/lib
- src/generated
3 files changed
+306
-299
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
9 | 12 | | |
10 | 13 | | |
11 | 14 | | |
| |||
47 | 50 | | |
48 | 51 | | |
49 | 52 | | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
50 | 57 | | |
51 | 58 | | |
52 | 59 | | |
| |||
92 | 99 | | |
93 | 100 | | |
94 | 101 | | |
95 | | - | |
| 102 | + | |
96 | 103 | | |
97 | 104 | | |
98 | 105 | | |
| |||
110 | 117 | | |
111 | 118 | | |
112 | 119 | | |
113 | | - | |
114 | | - | |
| 120 | + | |
| 121 | + | |
115 | 122 | | |
116 | 123 | | |
117 | 124 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | | - | |
| 69 | + | |
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| |||
0 commit comments