Re: [Mesa-dev] RFC: Memory allocation on Mesa

2020-05-11 Thread Brian Paul
On 05/11/2020 10:13 AM, Jose Fonseca wrote: Hi, To give everybody a bit of background context, this email comes from https://gitlab.freedesktop.org/mesa/mesa/-/issues/2911 . The short story is that Gallium components (but not Mesa) used to have their malloc/free calls intercepted, to

Re: [Mesa-dev] RFC: Memory allocation on Mesa

2020-05-11 Thread Tamminen, Eero T
Hi, On Mon, 2020-05-11 at 16:13 +, Jose Fonseca wrote: > Some might retort: why not just play some tricks with the linker, and > intercept all malloc/free calls, without actually having to modify > any source code? > > Yes, that's indeed technically feasible. And is precisely the sort > of

Re: [Mesa-dev] RFC: Memory allocation on Mesa

2020-05-11 Thread Timur Kristóf
On Mon, 2020-05-11 at 16:13 +, Jose Fonseca wrote: > Some might retort: why not just play some tricks with the linker, and > intercept all malloc/free calls, without actually having to modify > any source code? > > Yes, that's indeed technically feasible. And is precisely the sort > of trick

Re: [Mesa-dev] RFC: Memory allocation on Mesa

2020-05-11 Thread Jason Ekstrand
Sorry for the top-post. Very quick comment: If part of your objective is to fulfill Vulkan's requirements, we need a LOT more plumbing than just MALLOC/CALLOC/FREE. The Vulkan callbacks aren't set at a global level when the driver is loaded but are provided to every call that allocates anything

[Mesa-dev] RFC: Memory allocation on Mesa

2020-05-11 Thread Jose Fonseca
Hi, To give everybody a bit of background context, this email comes from https://gitlab.freedesktop.org/mesa/mesa/-/issues/2911 . The short story is that Gallium components (but not Mesa) used to have their malloc/free calls intercepted, to satisfy certain needs: 1) memory debugging on