Skip to content

Commit

Permalink
Make the max subroutine length compile-time configurable constant, de…
Browse files Browse the repository at this point in the history
…fault = 64KB
  • Loading branch information
leto committed May 14, 2010
1 parent ebdb710 commit b68004a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions config.h
@@ -0,0 +1,2 @@
/* Default max sub lenght of 64KB */
#define MAX_SUBROUTINE_LENGTH 1024*64
3 changes: 2 additions & 1 deletion plparrot.c
@@ -1,4 +1,5 @@
#include "plparrot.h"
#include "config.h"

/* Parrot header files */
#include "parrot/embed.h"
Expand Down Expand Up @@ -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); */
Expand Down

0 comments on commit b68004a

Please sign in to comment.