{
  "$type": "site.standard.document",
  "bskyPostRef": {
    "cid": "bafyreidm2cbky7zbzunm2plfirrqcj6movqvpba7o55yznid3n42qlqtmq",
    "uri": "at://did:plc:ivbknywyskln22er3nkssdhl/app.bsky.feed.post/3mmnl5elgfzd2"
  },
  "path": "/t/what-is-allocator-by-ref-for/24356#post_1",
  "publishedAt": "2026-05-25T02:53:32.000Z",
  "site": "https://internals.rust-lang.org",
  "textContent": "I was looking at the Allocator API that is currently being stabilized and noticed that it has an Allocator::by_ref method.\n\nI don't really understand what that method is for. It seems to simply return a shared reference to the allocator, so how is it any different from a simple borrow? Also the documentation for by_ref talks about returning an adapter of some kind, which it clearly does not do.\n\nI would appreciate any insight or further reading on why this method exists and what the documentation is talking about.",
  "title": "What is Allocator::by_ref for?"
}