The cfg_t object relies on the memory allocator zeroing out its
contents before it's initialized, which is quite an unusual practice
in the C++ world 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. Initialize all fields from the
constructor and stop using the zeroing allocator.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
{
mem_ctx = ralloc_context(parent_mem_ctx);
block_list.make_empty();
+ blocks = NULL;
num_blocks = 0;
ip = 0;
cur = NULL;
class cfg_t {
public:
- DECLARE_RZALLOC_CXX_OPERATORS(cfg_t)
+ DECLARE_RALLOC_CXX_OPERATORS(cfg_t)
cfg_t(backend_visitor *v);
cfg_t(void *mem_ctx, exec_list *instructions);