Skip to content
ProcMapsDeinit

ProcMapsDeinit

Description

Release storage owned by a ProcMaps. Safe on a zeroed struct. Storage is reclaimed through each container’s inline allocator — no separate allocator argument is needed.

Success

Returns to the caller. *self is zeroed.

Failure

Function cannot fail. NULL self is a no-op.

Usage example (Cross-references)

Usage examples (Cross-references)
        }
        VecDeinit(&self->cache);
        ProcMapsDeinit(&self->maps);
        MemSet(self, 0, sizeof(*self));
    }
            }
            if (!VecPushBackR(&out->entries, e)) {
                ProcMapsDeinit(out);
                return false;
            }
        if (!FileIsOpen(&f)) {
            LOG_ERROR("ProcMapsLoad: FileOpen(/proc/self/maps) failed");
            ProcMapsDeinit(out);
            return false;
        }
        if (!ok) {
            LOG_ERROR("ProcMapsLoad: FileRead failed");
            ProcMapsDeinit(out);
            return false;
        }
        if (StrLen(&out->raw) == 0) {
            LOG_ERROR("ProcMapsLoad: /proc/self/maps was empty");
            ProcMapsDeinit(out);
            return false;
        }
        if (!FileIsOpen(f)) {
            LOG_ERROR("ProcMapsLoadFrom: file is not open");
            ProcMapsDeinit(out);
            return false;
        }
        if (!proc_maps_read_all(f, &out->raw)) {
            LOG_ERROR("ProcMapsLoadFrom: FileRead failed");
            ProcMapsDeinit(out);
            return false;
        }
        if (len) {
            if (!StrReserve(&out->raw, len + 1)) {
                ProcMapsDeinit(out);
                return false;
            }
    }
    
    void ProcMapsDeinit(ProcMaps *self) {
        if (!self)
            return;
                }
            }
            ProcMapsDeinit(&maps);
        }
        DefaultAllocatorDeinit(&a);
                }
            }
            ProcMapsDeinit(&maps);
        }
        DefaultAllocatorDeinit(&a);
        ok = ok && any_exec;
    
        ProcMapsDeinit(&maps);
        DefaultAllocatorDeinit(&alloc);
        return ok;
        bool ok = entry != NULL && (entry->perms & PROC_MAP_PERM_EXEC) != 0;
    
        ProcMapsDeinit(&maps);
        DefaultAllocatorDeinit(&alloc);
        return ok;
        bool ok = VecLen(&maps.entries) > 5;
    
        ProcMapsDeinit(&maps);
        DefaultAllocatorDeinit(&alloc);
        return ok;
        ok = ok && fn_addr >= e->start && fn_addr < e->end;
    
        ProcMapsDeinit(&maps);
        DefaultAllocatorDeinit(&alloc);
        return ok;
        (void)local;
    
        ProcMapsDeinit(&maps);
        DefaultAllocatorDeinit(&alloc);
        return ok;
        }
    
        ProcMapsDeinit(&maps);
        DefaultAllocatorDeinit(&alloc);
        return ok;
        }
    
        ProcMapsDeinit(&maps);
        DefaultAllocatorDeinit(&alloc);
        return ok;
        bool ok = e == NULL;
    
        ProcMapsDeinit(&maps);
        DefaultAllocatorDeinit(&alloc);
        return ok;
        }
    
        ProcMapsDeinit(&maps);
        DefaultAllocatorDeinit(&alloc);
        return ok;
        bool pushed = VecPushBackR(&pm.entries, e0) && VecPushBackR(&pm.entries, e1) && VecPushBackR(&pm.entries, e2);
        if (!pushed) {
            ProcMapsDeinit(&pm);
            DebugAllocatorDeinit(&alloc);
            return false;
        ok                     = ok && h0 != NULL && h0->start == 0x1000 && h1 != NULL && h1->start == 0x3000;
    
        ProcMapsDeinit(&pm);
        DebugAllocatorDeinit(&alloc);
        return ok;
        bool ok     = during > before;
    
        ProcMapsDeinit(&maps);
    
        // After Deinit every load allocation is gone again.
        }
    
        ProcMapsDeinit(&maps);
        DefaultAllocatorDeinit(&alloc);
        return ok;
        }
    
        ProcMapsDeinit(&m);
        DefaultAllocatorDeinit(&alloc);
        return ok;
        }
    
        ProcMapsDeinit(&m);
        DefaultAllocatorDeinit(&alloc);
        return ok;
        }
    
        ProcMapsDeinit(&m);
        DefaultAllocatorDeinit(&alloc);
        return ok;
        bool ok = VecLen(&m.entries) == 0;
    
        ProcMapsDeinit(&m);
        DefaultAllocatorDeinit(&alloc);
        return ok;
        }
    
        ProcMapsDeinit(&m);
        DefaultAllocatorDeinit(&alloc);
        return ok;
        }
    
        ProcMapsDeinit(&m);
        DefaultAllocatorDeinit(&alloc);
        return ok;
            ok                    = e != NULL && e->start == 0xdeadbeef000ULL && e->end == 0xdeadbeef100ULL &&
                 ZstrCompare(e->path, "/late") == 0;
            ProcMapsDeinit(&m);
        }
Last updated on