Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
89e6db9b
Commit
89e6db9b
authored
Mar 06, 2026
by
Benjamin Woodruff
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove stupid TurboValueBuffer wrapper type
parent
fe742f15
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
24 deletions
+12
-24
arc_bytes.rs
turbopack/crates/turbo-persistence/src/arc_bytes.rs
+6
-0
mod.rs
...pack/crates/turbo-tasks-backend/src/database/turbo/mod.rs
+6
-24
No files found.
turbopack/crates/turbo-persistence/src/arc_bytes.rs
View file @
89e6db9b
...
...
@@ -58,6 +58,12 @@ impl Borrow<[u8]> for ArcBytes {
}
}
impl
AsRef
<
[
u8
]
>
for
ArcBytes
{
fn
as_ref
(
&
self
)
->
&
[
u8
]
{
self
}
}
impl
Hash
for
ArcBytes
{
fn
hash
<
H
:
Hasher
>
(
&
self
,
state
:
&
mut
H
)
{
self
.deref
()
.hash
(
state
)
...
...
turbopack/crates/turbo-tasks-backend/src/database/turbo/mod.rs
View file @
89e6db9b
...
...
@@ -40,14 +40,6 @@ const COMPACT_CONFIG: CompactConfig = CompactConfig {
max_merge_segment_count
:
16
,
};
pub
struct
TurboValueBuffer
(
ArcBytes
);
impl
AsRef
<
[
u8
]
>
for
TurboValueBuffer
{
fn
as_ref
(
&
self
)
->
&
[
u8
]
{
&
self
.
0
}
}
pub
struct
TurboKeyValueDatabase
{
db
:
Arc
<
TurboPersistence
<
TurboTasksParallelScheduler
,
FAMILIES
>>
,
compact_join_handle
:
Mutex
<
Option
<
JoinHandle
<
Result
<
()
>>>>
,
...
...
@@ -83,12 +75,12 @@ impl KeyValueDatabase for TurboKeyValueDatabase {
}
type
ValueBuffer
<
'l
>
=
TurboValueBuffer
=
ArcBytes
where
Self
:
'l
;
fn
get
<
'l
>
(
&
'l
self
,
key_space
:
KeySpace
,
key
:
&
[
u8
])
->
Result
<
Option
<
Self
::
ValueBuffer
<
'l
>>>
{
Ok
(
self
.db
.get
(
key_space
as
usize
,
&
key
)
?
.map
(
TurboValueBuffer
)
)
self
.db
.get
(
key_space
as
usize
,
&
key
)
}
fn
batch_get
<
'l
>
(
...
...
@@ -96,12 +88,7 @@ impl KeyValueDatabase for TurboKeyValueDatabase {
key_space
:
KeySpace
,
keys
:
&
[
&
[
u8
]],
)
->
Result
<
Vec
<
Option
<
Self
::
ValueBuffer
<
'l
>>>>
{
Ok
(
self
.db
.batch_get
(
key_space
as
usize
,
keys
)
?
.into_iter
()
.map
(|
value
|
value
.map
(
TurboValueBuffer
))
.collect
())
self
.db
.batch_get
(
key_space
as
usize
,
keys
)
}
fn
get_multiple
<
'l
>
(
...
...
@@ -109,12 +96,7 @@ impl KeyValueDatabase for TurboKeyValueDatabase {
key_space
:
KeySpace
,
key
:
&
[
u8
],
)
->
Result
<
SmallVec
<
[
Self
::
ValueBuffer
<
'l
>
;
1
]
>>
{
Ok
(
self
.db
.get_multiple
(
key_space
as
usize
,
&
key
)
?
.into_iter
()
.map
(
TurboValueBuffer
)
.collect
())
self
.db
.get_multiple
(
key_space
as
usize
,
&
key
)
}
type
ConcurrentWriteBatch
<
'l
>
...
...
@@ -214,7 +196,7 @@ pub struct TurboWriteBatch<'a> {
impl
<
'a
>
BaseWriteBatch
<
'a
>
for
TurboWriteBatch
<
'a
>
{
type
ValueBuffer
<
'l
>
=
TurboValueBuffer
=
ArcBytes
where
Self
:
'l
,
'a
:
'l
;
...
...
@@ -223,7 +205,7 @@ impl<'a> BaseWriteBatch<'a> for TurboWriteBatch<'a> {
where
'a
:
'l
,
{
Ok
(
self
.db
.get
(
key_space
as
usize
,
&
key
)
?
.map
(
TurboValueBuffer
)
)
self
.db
.get
(
key_space
as
usize
,
&
key
)
}
fn
commit
(
self
)
->
Result
<
()
>
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment