BufAllocator
Description
Allocator backing b’s storage. Read-only; rebinding the allocator after init is not supported.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Pdb.c:261:
}
self->stream_sizes = AllocatorAlloc(BufAllocator(&self->data), (size)sizes_bytes, 0);
self->stream_blocks = AllocatorAlloc(BufAllocator(&self->data), (size)ptrs_bytes, 0);
self->stream_block_counts = AllocatorAlloc(BufAllocator(&self->data), (size)counts_bytes, 0);- In
Pdb.c:262:
self->stream_sizes = AllocatorAlloc(BufAllocator(&self->data), (size)sizes_bytes, 0);
self->stream_blocks = AllocatorAlloc(BufAllocator(&self->data), (size)ptrs_bytes, 0);
self->stream_block_counts = AllocatorAlloc(BufAllocator(&self->data), (size)counts_bytes, 0);
if (!self->stream_sizes || !self->stream_blocks || !self->stream_block_counts)- In
Pdb.c:263:
self->stream_sizes = AllocatorAlloc(BufAllocator(&self->data), (size)sizes_bytes, 0);
self->stream_blocks = AllocatorAlloc(BufAllocator(&self->data), (size)ptrs_bytes, 0);
self->stream_block_counts = AllocatorAlloc(BufAllocator(&self->data), (size)counts_bytes, 0);
if (!self->stream_sizes || !self->stream_blocks || !self->stream_block_counts)
return false;- In
Pdb.c:459:
}
u32 n = sz / 40;
SectionRva *out = AllocatorAlloc(BufAllocator(&self->data), n * sizeof(SectionRva), 0);
if (!out)
return NULL;- In
Pdb.c:463:
return NULL;
u8 *buf = AllocatorAlloc(BufAllocator(&self->data), sz, 0);
if (!buf) {
AllocatorFree(BufAllocator(&self->data), out);- In
Pdb.c:465:
u8 *buf = AllocatorAlloc(BufAllocator(&self->data), sz, 0);
if (!buf) {
AllocatorFree(BufAllocator(&self->data), out);
return NULL;
}- In
Pdb.c:470:
bool read_ok = stream_read(self, section_hdr_stream, 0, buf, sz);
if (!read_ok) {
AllocatorFree(BufAllocator(&self->data), buf);
AllocatorFree(BufAllocator(&self->data), out);
return NULL;- In
Pdb.c:471:
if (!read_ok) {
AllocatorFree(BufAllocator(&self->data), buf);
AllocatorFree(BufAllocator(&self->data), out);
return NULL;
}- In
Pdb.c:480:
(void)BufReadU32LE(&rec, &out[i].virtual_address);
}
AllocatorFree(BufAllocator(&self->data), buf);
*out_count = n;
return out;- In
Pdb.c:535:
// Stream into a flat buffer; the record stream is typically large
// but not unbounded.
u8 *buf = AllocatorAlloc(BufAllocator(&self->data), sz, 0);
if (!buf)
return false;- In
Pdb.c:539:
return false;
if (!stream_read(self, symrec_stream, 0, buf, sz)) {
AllocatorFree(BufAllocator(&self->data), buf);
return false;
}- In
Pdb.c:592:
pp.rva = rva;
if (!pool_append_cstr(pool, name, &pp.name_offset_in_pool)) {
AllocatorFree(BufAllocator(&self->data), buf);
return false;
}- In
Pdb.c:596:
}
if (!VecPushBackR(pending, pp)) {
AllocatorFree(BufAllocator(&self->data), buf);
return false;
}- In
Pdb.c:605:
}
AllocatorFree(BufAllocator(&self->data), buf);
return true;
}- In
Pdb.c:619:
if (!sections || num_sections == 0) {
if (sections)
AllocatorFree(BufAllocator(&self->data), sections);
return true; // can't compute RVAs without section table
}- In
Pdb.c:625:
// Per-function names need an offset-into-pool indirection because
// the pool may grow during the walk.
Str name_pool = StrInit(BufAllocator(&self->data));
PendingPubs pending = VecInitT(pending, BufAllocator(&self->data));
bool ok = walk_publics(self, dbi.symrec_stream, sections, num_sections, &name_pool, &pending);- In
Pdb.c:626:
// the pool may grow during the walk.
Str name_pool = StrInit(BufAllocator(&self->data));
PendingPubs pending = VecInitT(pending, BufAllocator(&self->data));
bool ok = walk_publics(self, dbi.symrec_stream, sections, num_sections, &name_pool, &pending);
AllocatorFree(BufAllocator(&self->data), sections);- In
Pdb.c:628:
PendingPubs pending = VecInitT(pending, BufAllocator(&self->data));
bool ok = walk_publics(self, dbi.symrec_stream, sections, num_sections, &name_pool, &pending);
AllocatorFree(BufAllocator(&self->data), sections);
if (!ok) {- In
Pdb.c:764:
if (!self)
return;
Allocator *alloc = BufAllocator(&self->data);
BufDeinit(&self->data);
if (alloc) {
Last updated on