Thank you -- this is much simpler now.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
//! \brief Adds a property using `vm_read` for arbitrary-sized memory blocks.
//!
//! \return `true` if able to `vm_read` `value` `value_length` and write a
//! kProperty command with the `key` `value` `value_length` tuple.
//!
//! \note This method allocates a new VM page via `vm_read` in the calling
//! task's footprint. It should only be used for large memory reads
//! (e.g. thread stacks) where allocating a local stack buffer is unsafe.
bool AddPropertyBytesLarge(IntermediateDumpKey key,
const void* value,
size_t value_length);
//! \brief Adds a property using `vm_read_overwrite` and a local stack buffer.
//!
//! \return `true` if able to `vm_read_overwrite` `value` `value_length`
//! and write a kProperty command with the `key` `value` `value_length`
//! tuple.
//!
//! \note This method uses a `kMaxPropertyBytesSmallSize`-byte local stack
//! buffer to avoid allocating new virtual memory pages during the read.
//! `value_length` must be <= `kMaxPropertyBytesSmallSize`.
bool AddPropertyBytesSmall(IntermediateDumpKey key,
const void* value,
size_t value_length);
Justin CohenCan `AddPropertyBytes` take care of making the decision on its own, so we don’t need to pollute all of the call sites?
(Then `kMaxPropertyBytesSmallSize` wouldn’t need to be exposed either.)
Done
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
ios: Optimize small memory reads when writing intermediate dumps.
This CL optimizes memory reads by using `vm_read_overwrite` with a
512-byte stack buffer for small properties, avoiding unnecessary virtual
memory allocations. Larger reads continue to use `vm_read`.
The logic is encapsulated within `AddPropertyBytes`, which automatically
selects the optimal read method based on the property size.
This also adds a test to verify `CaptureMemoryPointedToByThreadState`.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |