summaryrefslogtreecommitdiffstats
path: root/src/util/ralloc.h
Commit message (Collapse)AuthorAgeFilesLines
* util/ralloc: Fix `extern "C"` usage.Jose Fonseca2015-04-131-4/+4
| | | | | Reviewed-by: Roland Scheidegger <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* ralloc: Implement a new ralloc_adopt() API.Kenneth Graunke2015-04-021-0/+7
| | | | | | | | | | | | | | | | | | | | | ralloc_adopt() reparents all children from one context to another. Conceptually, ralloc_adopt(new_ctx, old_ctx) behaves like this pseudocode: foreach child of old_ctx: ralloc_steal(new_ctx, child) However, ralloc provides no way to iterate over a memory context's children, and ralloc_adopt does this task more efficiently anyway. One potential use of this is to implement a memory-sweeper pass: first, steal all of a context's memory to a temporary context. Then, walk over anything that should be kept, and ralloc_steal it back to the original context. Finally, free the temporary context. This works when the context is something that can't be freed (i.e. an important structure). Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* ralloc: Mark ralloc functions with gcc's malloc attribute.Matt Turner2014-09-251-8/+8
| | | | | | | Cuts a few hundred bytes from the DRI drivers, so it must give gcc some extra information. Reviewed-by: Ian Romanick <[email protected]>
* util: Gather some common macrosJason Ekstrand2014-08-041-1/+2
| | | | | | | | | | This gathers macros that have been included across components into util so that the include chain can be more vertical. In particular, this makes util stand on its own without any dependence whatsoever on the rest of mesa. Signed-off-by: "Jason Ekstrand" <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* util: Move ralloc to a new src/util directory.Kenneth Graunke2014-08-041-0/+444
For a long time, we've wanted a place to put utility code which isn't directly tied to Mesa or Gallium internals. This patch creates a new src/util directory for exactly that purpose, and builds the contents as libmesautil.la. ralloc seemed like a good first candidate. These days, it's directly used by mesa/main, i965, i915, and r300g, so keeping it in src/glsl didn't make much sense. Signed-off-by: Kenneth Graunke <[email protected]> v2 (Jason Ekstrand): More realloc uses and some scons fixes Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Marek Olšák <[email protected]>