summaryrefslogtreecommitdiffstats
path: root/src/util/vma.h
Commit message (Collapse)AuthorAgeFilesLines
* util/vma: Add a function to allocate a particular address rangeJason Ekstrand2019-12-051-0/+3
| | | | | | | | | | | This new function lets you request to remove a specific address range from the allocator. It returns true on success and leaves the allocator unmodified and returns false on failure. It doesn't need to return an offset because, if it succeeds, the offset passed in is the allocated offset. Reviewed-by: Ivan Briano <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* util: Add a virtual memory allocatorJason Ekstrand2018-05-311-0/+53
This is simple linear-walk first-fit allocator roughly based on the allocator in the radeon winsys code. This allocator has two primary functional differences: 1) It cleanly returns 0 on allocation failure 2) It allocates addresses top-down instead of bottom-up. The second one is needed for Intel because high addresses (with bit 47 set) need to be canonicalized in order to work properly. If we allocate bottom-up, then high addresses will be very rare (if they ever happen). We'd rather always have high addresses so that the canonicalization code gets better testing. v2: - [scott-ph] remove _heap_validate() if NDEBUG is defined (Jordan) Reviewed-by: Scott D Phillips <[email protected]> Tested-by: Scott D Phillips <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>