Skip to content

ElfFileDeinit

Description

Release storage owned by an ElfFile. Frees the byte buffer if owns_data was true. Safe to call on a zeroed struct.

Usage example (Cross-references)

Usage examples (Cross-references)
        if (built)
            DwarfLinesDeinit(&lines);
        ElfFileDeinit(&elf);
        DefaultAllocatorDeinit(&alloc);
        return ok;
        }
    
        ElfFileDeinit(&elf);
        SymbolResolverDeinit(&res);
        DefaultAllocatorDeinit(&alloc);
        ok = ok && elf.symbols.length > 0;
    
        ElfFileDeinit(&elf);
        DefaultAllocatorDeinit(&alloc);
        return ok;
        bool              ok   = text != NULL && text->size > 0 && (text->flags & 0x4); // SHF_EXECINSTR = 0x4
    
        ElfFileDeinit(&elf);
        DefaultAllocatorDeinit(&alloc);
        return ok;
        }
    
        ElfFileDeinit(&elf);
        DefaultAllocatorDeinit(&alloc);
        return ok;
        }
        if (!VecPushBackR(&self->cache, entry)) {
            ElfFileDeinit(&entry.elf);
            return NULL;
        }
            }
    #endif
            ElfFileDeinit(&e->elf);
        }
        VecDeinit(&self->cache);
    
    fail:
        ElfFileDeinit(out);
        return false;
    }
    }
    
    void ElfFileDeinit(ElfFile *self) {
        if (!self)
            return;
Last updated on