PdbOpenFromMemory
Description
Open and parse a PDB from an in-memory byte range – L-value / ownership-transfer form (mirrors VecInsertL).
data is u8 **: ownership is moving from caller to parser. On entry *data is the caller’s buffer (allocated through alloc); on exit (success OR failure) *data == NULL. Calling code:
u8 *buf = my_buffer; PdbOpenFromMemory(&pdb, &buf, n, &alloc); // buf == NULL afterwards.
Success
Returns true; out owns the bytes; *data == NULL.
Failure
Returns false; the bytes have been freed through alloc; *data == NULL; out is left zeroed.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Pdb.c:691:
// L-value form. `data` is `u8 **` -- ownership of the pointer moves
// from caller to parser. On exit `*data == NULL` (success or failure).
bool PdbOpenFromMemory(Pdb *out, Buf *in) {
if (!out || !in || !in->data || !in->allocator) {
LOG_FATAL("PdbOpenFromMemory: NULL argument (contract violation)");- In
Pdb.c:693:
bool PdbOpenFromMemory(Pdb *out, Buf *in) {
if (!out || !in || !in->data || !in->allocator) {
LOG_FATAL("PdbOpenFromMemory: NULL argument (contract violation)");
}
Buf taken = *in;- In
Pdb.c:734:
MemCopy(BufData(©), data, data_size);
copy.length = (size)data_size;
return PdbOpenFromMemory(out, ©);
}- In
Pdb.c:747:
return false;
}
return PdbOpenFromMemory(out, &data);
}
Last updated on