Mesa (master): i965: Switch ip_record to the non-zeroing allocator.

Francisco Jerez currojerez at kemper.freedesktop.org
Wed Oct 2 00:42:34 UTC 2013


Module: Mesa
Branch: master
Commit: a5d843ebdf771cb0a2ac46512679f19dd5550535
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=a5d843ebdf771cb0a2ac46512679f19dd5550535

Author: Francisco Jerez <currojerez at riseup.net>
Date:   Fri Sep 20 16:31:16 2013 -0700

i965: Switch ip_record to the non-zeroing allocator.

All member variables of ip_record are already being initialized from
its constructor, it's not necessary to use rzalloc to allocate its
memory, and doing so makes it more likely that we will start relying
on the allocator to zero out all memory if the class is ever extended
with new member variables.

That's bad because it ties objects to some specific allocation scheme,
and gives unpredictable results when an object is created with a
different allocator -- Stack allocation, array allocation, or
aggregation inside a different object are some of the useful
possibilities that come to my mind.

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>

---

 src/mesa/drivers/dri/i965/brw_fs.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_fs.h b/src/mesa/drivers/dri/i965/brw_fs.h
index b2aa041..8d35112 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.h
+++ b/src/mesa/drivers/dri/i965/brw_fs.h
@@ -112,7 +112,7 @@ static const fs_reg reg_null_d(ARF, BRW_ARF_NULL, BRW_REGISTER_TYPE_D);
 
 class ip_record : public exec_node {
 public:
-   DECLARE_RZALLOC_CXX_OPERATORS(ip_record)
+   DECLARE_RALLOC_CXX_OPERATORS(ip_record)
 
    ip_record(int ip)
    {




More information about the mesa-commit mailing list