Skip to content

Request: More flexible MemoryRegion allocation #54

@GrizzZ13

Description

@GrizzZ13

Is it possible to allocate a MemoryRegion from a raw pointer or user-managed memory rather than Vec<T> ? Sometimes I would like to allocate memory using mmap to enable huge pages, but it seems like current APIs do not work well for this request.

It would be good if we add methods like this:

impl<'ctx> ProtectionDomain<'ctx> {
    pub unsafe fn allocate_from_raw<T: Sized + Copy + Default>(&self, ptr: *mut u8, n: usize) -> io::Result<MemoryRegion<T>> {
        todo!();
    }
}

Thanks for your time :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions