Skip to content
Browse files

Make the max subroutine length compile-time configurable constant, de…

…fault = 64KB
  • Loading branch information...
1 parent ebdb710 commit b68004ad3f4f44d5f22d0ebaa815b4965f738695 @leto committed May 13, 2010
Showing with 4 additions and 1 deletion.
  1. +2 −0 config.h
  2. +2 −1 plparrot.c
View
2 config.h
@@ -0,0 +1,2 @@
+/* Default max sub lenght of 64KB */
+#define MAX_SUBROUTINE_LENGTH 1024*64
View
3 plparrot.c
@@ -1,4 +1,5 @@
#include "plparrot.h"
+#include "config.h"
/* Parrot header files */
#include "parrot/embed.h"
@@ -182,7 +183,7 @@ plparrot_func_handler(PG_FUNCTION_ARGS)
pir_src = malloc( 13 + length + 4 );
memcpy(pir_src, pir_begin, 13);
/* This should have a sane default and be configurable */
- strncat(pir_src, proc_src, 1000);
+ strncat(pir_src, proc_src, MAX_SUBROUTINE_LENGTH);
strncat(pir_src, pir_end, 4);
/* elog(NOTICE,"about to compile a PIR string: %s", pir_src); */

0 comments on commit b68004a

Please sign in to comment.
Something went wrong with that request. Please try again.