summaryrefslogtreecommitdiffstats
path: root/src/mesa/shader/slang/slang_emit.c
diff options
context:
space:
mode:
authorBrian <[email protected]>2007-04-21 12:08:56 -0600
committerBrian <[email protected]>2007-04-21 12:30:58 -0600
commitcd3e39340f057712fcf02a35dff85645e475053a (patch)
treea7c6e2d0d6be2ccaa882075539e38935b77b5522 /src/mesa/shader/slang/slang_emit.c
parentad3cc95485c488e3920f9c460b373338043000c5 (diff)
Use new memory pool allocator. Lots of debug code still in place...
Diffstat (limited to 'src/mesa/shader/slang/slang_emit.c')
-rw-r--r--src/mesa/shader/slang/slang_emit.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mesa/shader/slang/slang_emit.c b/src/mesa/shader/slang/slang_emit.c
index badeb69b3fe..c6683720191 100644
--- a/src/mesa/shader/slang/slang_emit.c
+++ b/src/mesa/shader/slang/slang_emit.c
@@ -45,6 +45,7 @@
#include "prog_print.h"
#include "slang_builtin.h"
#include "slang_emit.h"
+#include "slang_mem.h"
#define PEEPHOLE_OPTIMIZATIONS 1
@@ -126,7 +127,11 @@ slang_ir_storage *
_slang_new_ir_storage(enum register_file file, GLint index, GLint size)
{
slang_ir_storage *st;
+#if USE_MEMPOOL
+ st = (slang_ir_storage *) _slang_alloc(sizeof(slang_ir_storage));
+#else
st = (slang_ir_storage *) _mesa_calloc(sizeof(slang_ir_storage));
+#endif
if (st) {
st->File = file;
st->Index = index;
@@ -151,7 +156,11 @@ alloc_temp_storage(slang_emit_info *emitInfo, slang_ir_node *n, GLint size)
if (!_slang_alloc_temp(emitInfo->vt, n->Store)) {
slang_info_log_error(emitInfo->log,
"Ran out of registers, too many temporaries");
+#if USE_MEMPOOL
+ _slang_free(n->Store);
+#else
_mesa_free(n->Store);
+#endif
n->Store = NULL;
return GL_FALSE;
}