Skip to content

Commit

Permalink
Add an impl for ThreadId
Browse files Browse the repository at this point in the history
Summary: Useful in a project I was working on.

Reviewed By: stepancheg

Differential Revision: D66030834

fbshipit-source-id: 2b50cb0aa52eeeebf5968b6de5c81680b8f3c1dc
  • Loading branch information
ndmitchell authored and facebook-github-bot committed Nov 16, 2024
1 parent 438186d commit 198dbe8
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions allocative/allocative/src/impls/std/thread.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under both the MIT license found in the
* LICENSE-MIT file in the root directory of this source tree and the Apache
* License, Version 2.0 found in the LICENSE-APACHE file in the root directory
* of this source tree.
*/

use std::thread::ThreadId;

use crate::allocative_trait::Allocative;
use crate::visitor::Visitor;

impl Allocative for ThreadId {
fn visit<'a, 'b: 'a>(&self, visitor: &'a mut Visitor<'b>) {
visitor.enter_self_sized::<Self>().exit();
}
}

0 comments on commit 198dbe8

Please sign in to comment.