Skip to content
PageAllocatorDeinit

PageAllocatorDeinit

Description

Tear down a PageAllocator. Any region still tracked in entries (a caller leak, e.g. forgot to AllocatorFree) is munmapped so the kernel doesn’t keep the mapping around. The descriptor table itself is then released and the struct is zeroed – post-deinit dispatch trips ValidateAllocator on the zeroed __magic.

Parameters

Name Direction Description
self in,out PageAllocator instance, or NULL.

Success

Function returns. Every live mapping owned by this allocator has been released; the struct is fully zeroed and cannot be used until re-initialised.

Failure

No action when self is NULL.

Usage example (Cross-references)

Usage examples (Cross-references)
    
    
    void PageAllocatorDeinit(PageAllocator *self) {
        if (!self) {
            return;
    
        AllocatorFree(&page, region);
        PageAllocatorDeinit(&page);
        return ok;
    }
        }
    
        PageAllocatorDeinit(&alloc);
        return ok;
    }
        }
    
        PageAllocatorDeinit(&alloc);
        return ok;
    }
        ok = ok && (VecLen(&v) == 1024) && (VecAt(&v, 0) == 0) && (VecAt(&v, 1023) == 1023);
        VecDeinit(&v);
        PageAllocatorDeinit(&alloc);
        return ok;
    }
        }
    
        PageAllocatorDeinit(&alloc);
        return ok;
    }
        }
    
        PageAllocatorDeinit(&alloc);
        // Post-deinit the struct is zeroed: both accessors return 0.
        if (PageAllocatorEntryCount(&alloc) != 0) {
    
        GraphDeinit(&graph);
        PageAllocatorDeinit(&alloc);
        return true;
    }
Last updated on