Commit 3af3e638 by Martijn Vels Committed by Copybara-Service

Reorganize InlineData into an inner Rep structure.

This moves inlined code around a bit without changing anything bar the names of things. The purpose for all this is that it greatly simplifies the process of adding memory poisining to Cord / InlineData. InlineData can have scoped poison / unpoison regions around the interface, calling into rep for the 'real code'. I.e.:

Rep::as_chars() { return &inline_data[1]; }

InlineData::as_chars() {
  Unpoisoned self(this);
  return rep_.as_chars();
}

Likewise, it greatly simplifies intercepting the code for constructors, copy constructors and operator= logic.

PiperOrigin-RevId: 480893031
Change-Id: I050c88caff2315939d95a0361ae20528be36a96b
parent fbe46601
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment