@@ -42,7 +42,7 @@ use serde::{Serialize, Deserialize};
42
42
use serde_json;
43
43
#[ cfg( any( feature = "capture" , feature = "replay" ) ) ]
44
44
use std:: path:: PathBuf ;
45
- use std:: sync:: atomic:: { ATOMIC_USIZE_INIT , AtomicUsize , Ordering } ;
45
+ use std:: sync:: atomic:: { AtomicUsize , Ordering } ;
46
46
use std:: mem:: replace;
47
47
use std:: os:: raw:: c_void;
48
48
use std:: sync:: mpsc:: { channel, Sender , Receiver } ;
@@ -360,7 +360,8 @@ impl DocumentOps {
360
360
}
361
361
362
362
/// The unique id for WR resource identification.
363
- static NEXT_NAMESPACE_ID : AtomicUsize = ATOMIC_USIZE_INIT ;
363
+ /// The namespace_id should start from 1.
364
+ static NEXT_NAMESPACE_ID : AtomicUsize = AtomicUsize :: new ( 1 ) ;
364
365
365
366
#[ cfg( any( feature = "capture" , feature = "replay" ) ) ]
366
367
#[ cfg_attr( feature = "capture" , derive( Serialize ) ) ]
@@ -419,9 +420,6 @@ impl RenderBackend {
419
420
sampler : Option < Box < AsyncPropertySampler + Send > > ,
420
421
size_of_op : Option < VoidPtrToSizeFn > ,
421
422
) -> RenderBackend {
422
- // The namespace_id should start from 1.
423
- NEXT_NAMESPACE_ID . fetch_add ( 1 , Ordering :: Relaxed ) ;
424
-
425
423
RenderBackend {
426
424
api_rx,
427
425
payload_rx,
0 commit comments