aboutsummaryrefslogtreecommitdiffstats
path: root/src/util/ralloc.h
Commit message (Collapse)AuthorAgeFilesLines
* util/ralloc: add ralloc_str_append() helperTimothy Arceri2017-08-111-0/+18
| | | | | | | | This function differs from ralloc_strcat() and ralloc_strncat() in that it does not do any strlen() calls which can become costly on large strings. Reviewed-by: Thomas Helland <[email protected]>
* ralloc: Delete autofree handling.Kenneth Graunke2017-02-271-9/+0
| | | | | | | | | | | | | There was exactly one user of this, and I just removed it. It also accessed an implicit global context, with no locking. This meant that it was only safe if all callers of ralloc_autofree_context() held the same lock...which is a pretty terrible thing for a utility library to impose. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* ralloc: add a linear allocator as a child node of rallocMarek Olšák2016-10-311-4/+80
| | | | | | | v2: remove goto, cosmetic changes Tested-by: Edmondo Tommasina <[email protected]> (v1) Reviewed-by: Nicolai Hähnle <[email protected]>
* ralloc: add DECLARE_RZALLOC_CXX_OPERATORSMarek Olšák2016-10-311-2/+7
| | | | | | | Reviewed-by: Edward O'Callaghan <[email protected]> Tested-by: Edmondo Tommasina <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* 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]>