Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[JITLink] Add convenience methods for creating block readers / writers.
This saves clients some boilerplate compared to setting up the readers and writers manually. To obtain a BinaryStreamWriter / BinaryStreamReader for a given block, B, clients can now write: auto Reader = G.getBlockContentReader(B); and auto Writer = G.getBlockContentWriter(B); The latter will trigger a copy to mutable memory allocated on the graph's allocator if the block is currently marked as backed by read-only memory. This commit also introduces a new createMutableContentBlock overload that creates a block with a given size and zero-filled content (by default -- passing false for the ZeroInitialize bypasses initialization entirely). This overload is intended to be used with getBlockContentWriter above when creating new content for the graph.
- Loading branch information
Showing
2 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters