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 (!FileIsOpen(&f)) {
            LOG_ERROR("ProcMapsLoad: FileOpen(/proc/self/maps) failed");
            ProcMapsDeinit(out);
            return false;
        }
                LOG_ERROR("ProcMapsLoad: failed to grow buffer");
                FileClose(&f);
                ProcMapsDeinit(out);
                return false;
            }
                LOG_ERROR("ProcMapsLoad: FileRead failed");
                FileClose(&f);
                ProcMapsDeinit(out);
                return false;
            }
        if (StrLen(&out->raw) == 0) {
            LOG_ERROR("ProcMapsLoad: /proc/self/maps was empty");
            ProcMapsDeinit(out);
            return false;
        }
            }
            if (!VecPushBackR(&out->entries, e)) {
                ProcMapsDeinit(out);
                return false;
            }
    }
    
    void ProcMapsDeinit(ProcMaps *self) {
        if (!self)
            return;
                }
            }
            ProcMapsDeinit(&maps);
        }
        DefaultAllocatorDeinit(&a);
        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;
        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 ok     = during > before;
    
        ProcMapsDeinit(&maps);
    
        // After Deinit every load allocation is gone again.
        }
    
        ProcMapsDeinit(&maps);
        DefaultAllocatorDeinit(&alloc);
        return ok;
Last updated on