ir_dead_functions: Actually free dead functions and signatures.
authorKenneth Graunke <kenneth@whitecape.org>
Tue, 9 Nov 2010 00:10:46 +0000 (16:10 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Tue, 9 Nov 2010 00:22:15 +0000 (16:22 -0800)
This makes linked shaders use around 36k less memory since the
built-in prototypes are now freed.

src/glsl/ir_dead_functions.cpp

index 26554441d3a9d2174c5a0503c0ca4908194ce754..16037a2632d53838ad7ce419327b53a5ffdecf21 100644 (file)
@@ -125,6 +125,7 @@ do_dead_functions(exec_list *instructions)
 
       if (!entry->used) {
         entry->signature->remove();
+        delete entry->signature;
         progress = true;
       }
       delete(entry);
@@ -143,6 +144,7 @@ do_dead_functions(exec_list *instructions)
          * symbol table should be OK.
          */
         func->remove();
+        delete func;
         progress = true;
       }
    }