| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent ba9b2f0 commit d3fc791
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -100,9 +100,16 @@ Examples of these being used are pervasive through the `src/crypto` code. | |||
| 100 | 100 | ||
| 101 | 101 | The `ByteSource` class is a helper utility representing a _read-only_ byte | |
| 102 | 102 | array. Instances can either wrap external ("foreign") data sources, such as | |
| 103 | - an `ArrayBuffer` (`v8::BackingStore`) or allocated data. If allocated data | ||
| 104 | - is used, then the allocation is freed automatically when the `ByteSource` is | ||
| 105 | - destroyed. | ||
| 103 | + an `ArrayBuffer` (`v8::BackingStore`), or allocated data. | ||
| 104 | + | ||
| 105 | + * If a pointer to external data is used to create a `ByteSource`, that pointer | ||
| 106 | + must remain valid until the `ByteSource` is destroyed. | ||
| 107 | + * If allocated data is used, then it must have been allocated using OpenSSL's | ||
| 108 | + allocator. It will be freed automatically when the `ByteSource` is destroyed. | ||
| 109 | + | ||
| 110 | + The `ByteSource::Builder` class can be used to allocate writable memory that can | ||
| 111 | + then be released as a `ByteSource`, making it read-only, or freed by destroying | ||
| 112 | + the `ByteSource::Builder` without releasing it as a `ByteSource`. | ||
| 106 | 113 | ||
| 107 | 114 | ### `ArrayBufferOrViewContents` | |
| 108 | 115 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments