We should standardize on a single API. The names read and write seem simplest. The _bytes is superfluous since the VarnodeData::size indicates how much should be read or written, and this field is in bytes.
Nearly all calls ultimately call read_bytes_owned, so it's questionable if the sister API read_bytes is necessary. The non-owned reads occur when reading values which cannot be symbolic (e.g. reading memory to load instructions). Seems a better API would be read_concrete which internally could avoid cloning the data prior to concretization.
Memory tree uses
read
andwrite
but memory usesread_bytes_owned
andwrite_bytes
.https://github.com/mnemonikr/pcode/blob/9694e9ba6563ce5cc328aa2d97d406a28db0516a/src/mem.rs#L298-L299
https://github.com/mnemonikr/pcode/blob/9694e9ba6563ce5cc328aa2d97d406a28db0516a/src/mem.rs#L336-L337
read
andwrite
seem simplest. The_bytes
is superfluous since theVarnodeData::size
indicates how much should be read or written, and this field is in bytes.read_bytes_owned
, so it's questionable if the sister APIread_bytes
is necessary. The non-owned reads occur when reading values which cannot be symbolic (e.g. reading memory to load instructions). Seems a better API would beread_concrete
which internally could avoid cloning the data prior to concretization.