ralloc: Hook up C++ destructors to ralloc when necessary.
authorFrancisco Jerez <currojerez@riseup.net>
Wed, 9 Oct 2013 18:02:51 +0000 (11:02 -0700)
committerFrancisco Jerez <currojerez@riseup.net>
Tue, 29 Oct 2013 19:40:55 +0000 (12:40 -0700)
commitd18477deea5364847ca6d4be1ce6baa6c8c3fa9c
tree5110c2af84f244792f35e9b510994d8878a89921
parent98ab905af0e0eedf0cfbd9c466f6ae587f5b20c9
ralloc: Hook up C++ destructors to ralloc when necessary.

This patch makes sure that class destructors are called as they should
be when a C++ object allocated by ralloc is released.

Based on a previous patch by Kenneth Graunke, but it doesn't exhibit
the ~0.8% performance regression in shader compilation times because
we now use the HAS_TRIVIAL_DESTRUCTOR() macro to detect the typical
case where the indirect function call can be avoided because the
object's destructor doesn't need to do anything.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/glsl/ralloc.h