mojoshader_preprocessor.c
changeset 949 356f04114580
parent 945 f00ea3986db8
child 950 dcbf30c07fc9
--- a/mojoshader_preprocessor.c	Thu Nov 11 04:15:27 2010 -0500
+++ b/mojoshader_preprocessor.c	Thu Nov 11 04:20:31 2010 -0500
@@ -533,7 +533,6 @@
         state->filename = stringcache(ctx->filename_cache, fname);
         if (state->filename == NULL)
         {
-            out_of_memory(ctx);
             put_include(ctx, state);
             return 0;
         } // if
@@ -623,7 +622,7 @@
     ctx->close_callback = close_callback;
     ctx->asm_comments = asm_comments;
 
-    ctx->filename_cache = stringcache_create(m, f, d);
+    ctx->filename_cache = stringcache_create(MallocBridge, FreeBridge, ctx);
     okay = ((okay) && (ctx->filename_cache != NULL));
 
     ctx->file_macro = get_define(ctx);
@@ -868,9 +867,7 @@
     } // if
 
     const char *cached = stringcache(ctx->filename_cache, filename);
-    if (cached == NULL)
-        out_of_memory(ctx);
-    state->filename = cached;
+    state->filename = cached;  // may be NULL if stringcache() failed.
     state->line = linenum;
 } // handle_pp_line