BufDeinit
Description
Release the backing storage of a Buf through its inline allocator.
Success
Returns to the caller. *b is zeroed.
Failure
Macro cannot fail. Safe on a zeroed Buf.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
MachO.c:449:
Buf data = BufInit(alloc);
if (FileReadAndClose(path, &data) < 0) {
BufDeinit(&data);
LOG_ERROR("MachoOpen: failed to read {}", path);
return false;- In
MachO.c:459:
if (!self)
return;
BufDeinit(&self->data);
VecDeinit(&self->segments);
VecDeinit(&self->sections);- In
Elf.c:483:
Buf data = BufInit(alloc);
if (FileReadAndClose(path, &data) < 0) {
BufDeinit(&data);
LOG_ERROR("ElfOpen: failed to read {}", path);
return false;- In
Elf.c:493:
if (!self)
return;
BufDeinit(&self->data);
VecDeinit(&self->sections);
VecDeinit(&self->symbols);- In
Pdb.c:754:
Buf data = BufInit(alloc);
if (FileReadAndClose(path, &data) < 0) {
BufDeinit(&data);
LOG_ERROR("PdbOpen: failed to read {}", path);
return false;- In
Pdb.c:765:
return;
Allocator *alloc = BufAllocator(&self->data);
BufDeinit(&self->data);
if (alloc) {
if (self->name_pool)- In
Pe.c:554:
Buf data = BufInit(alloc);
if (FileReadAndClose(path, &data) < 0) {
BufDeinit(&data);
LOG_ERROR("PeOpen: failed to read {}", path);
return false;- In
Pe.c:564:
if (!self)
return;
BufDeinit(&self->data);
VecDeinit(&self->sections);
MemSet(self, 0, sizeof(*self));- In
Buf.c:22:
BufClear(&b);
ok = ok && BufLength(&b) == 0;
BufDeinit(&b);
DefaultAllocatorDeinit(&alloc);
return ok;- In
Buf.c:45:
};
bool ok = BufLength(&b) == sizeof(expect) && MemCompare(BufData(&b), expect, sizeof(expect)) == 0;
BufDeinit(&b);
DefaultAllocatorDeinit(&alloc);
return ok;- In
Buf.c:59:
const u8 expect_uleb[] = {0x00, 0x7F, 0x80, 0x01, 0x80, 0x80, 0x01};
if (BufLength(&b) != sizeof(expect_uleb) || MemCompare(BufData(&b), expect_uleb, sizeof(expect_uleb)) != 0) {
BufDeinit(&b);
DefaultAllocatorDeinit(&alloc);
return false;- In
Buf.c:72:
bool ok = BufLength(&b) == sizeof(expect_sleb) && MemCompare(BufData(&b), expect_sleb, sizeof(expect_sleb)) == 0;
BufDeinit(&b);
DefaultAllocatorDeinit(&alloc);
return ok;- In
Buf.c:83:
const u8 expect[] = {'h', 'i', 0};
bool ok = BufLength(&b) == sizeof(expect) && MemCompare(BufData(&b), expect, sizeof(expect)) == 0;
BufDeinit(&b);
DefaultAllocatorDeinit(&alloc);
return ok;- In
Buf.c:108:
ok = ok && IterRemainingLength(&it) == 0;
BufDeinit(&b);
DefaultAllocatorDeinit(&alloc);
return ok;- In
Buf.c:126:
ok = ok && IterRemainingLength(&it) == 0;
BufDeinit(&b);
DefaultAllocatorDeinit(&alloc);
return ok;- In
Buf.c:143:
ok = ok && IterRemainingLength(&it) == 0;
BufDeinit(&b);
DefaultAllocatorDeinit(&alloc);
return ok;- In
Buf.c:159:
const u8 expect[] = {0x99, 0xFE, 0xCA, 0xDE, 0xAD, 0xBE, 0xEF};
ok = ok && BufLength(&b) == sizeof(expect) && MemCompare(BufData(&b), expect, sizeof(expect)) == 0;
BufDeinit(&b);
DefaultAllocatorDeinit(&alloc);
return ok;- In
Buf.c:173:
const u8 expect[] = {0x34, 0x12};
ok = ok && BufLength(&b) == sizeof(expect) && MemCompare(BufData(&b), expect, sizeof(expect)) == 0;
BufDeinit(&b);
DefaultAllocatorDeinit(&alloc);
return ok;- In
Buf.c:208:
ok = ok && BufLength(&b) == BufLength(&snapshot);
ok = ok && MemCompare(BufData(&b), BufData(&snapshot), BufLength(&b)) == 0;
BufDeinit(&snapshot);
BufDeinit(&b);- In
Buf.c:210:
BufDeinit(&snapshot);
BufDeinit(&b);
DefaultAllocatorDeinit(&alloc);
return ok;- In
Buf.c:228:
ok = ok && IterRemainingLength(&it) == 0;
BufDeinit(&b);
DefaultAllocatorDeinit(&alloc);
return ok;- In
Buf.c:246:
ok = ok && it.pos == entry && v32 == 0;
BufDeinit(&b);
DefaultAllocatorDeinit(&alloc);
return ok;
Last updated on