summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/context.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2000-02-12 17:26:15 +0000
committerBrian Paul <[email protected]>2000-02-12 17:26:15 +0000
commit3ab6bbe6135da26dfe9a9ba880386fdc98f6580a (patch)
tree6b7a557c08a8f52ef7c9484e17a2d6cb3099d1c1 /src/mesa/main/context.c
parentef5d084d3c86beb132ddf9829d28ea78cb9f0197 (diff)
now using dynamically allocated api dispatch tables
Diffstat (limited to 'src/mesa/main/context.c')
-rw-r--r--src/mesa/main/context.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index 19ef322160c..2fa8848dcf1 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -1,4 +1,4 @@
-/* $Id: context.c,v 1.42 2000/02/03 19:40:07 brianp Exp $ */
+/* $Id: context.c,v 1.43 2000/02/12 17:26:15 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -1374,9 +1374,19 @@ GLboolean gl_initialize_context_data( GLcontext *ctx,
}
/* setup API dispatch tables */
- _mesa_init_exec_table( &ctx->Exec );
- _mesa_init_dlist_table( &ctx->Save );
- ctx->CurrentDispatch = &ctx->Exec;
+ ctx->Exec = CALLOC(_glapi_get_dispatch_table_size() * sizeof(void *));
+ ctx->Save = CALLOC(_glapi_get_dispatch_table_size() * sizeof(void *));
+ if (!ctx->Exec || !ctx->Save) {
+ free_shared_state(ctx, ctx->Shared);
+ FREE(ctx->VB);
+ FREE(ctx->PB);
+ if (ctx->Exec)
+ FREE(ctx->Exec);
+ FREE(ctx);
+ }
+ _mesa_init_exec_table( ctx->Exec );
+ _mesa_init_dlist_table( ctx->Save );
+ ctx->CurrentDispatch = ctx->Exec;
return GL_TRUE;
}
@@ -1513,6 +1523,9 @@ void gl_free_context_data( GLcontext *ctx )
ctx->freed_im_queue = next;
}
gl_extensions_dtr(ctx);
+
+ FREE(ctx->Exec);
+ FREE(ctx->Save);
}