diff --git a/Doc/Manual/CSharp.html b/Doc/Manual/CSharp.html index bd94a70c6..18731afe6 100644 --- a/Doc/Manual/CSharp.html +++ b/Doc/Manual/CSharp.html @@ -71,6 +71,10 @@ The most notable differences to Java are the following: When invoking SWIG use the -csharp command line option instead of -java. +
  • +The -nopgcpp command line option does not exist. +
  • +
  • The -package command line option does not exist.
  • diff --git a/Doc/Manual/Java.html b/Doc/Manual/Java.html index 116318528..e70e75515 100644 --- a/Doc/Manual/Java.html +++ b/Doc/Manual/Java.html @@ -268,8 +268,8 @@ swig -java -help --package <name> -set name of the Java package to <name> +-nopgcpp +suppress the premature garbage collection prevention parameter @@ -277,6 +277,11 @@ swig -java -help generate the low-level functional interface instead of proxy classes + +-package <name> +set name of the Java package to <name> + +

    @@ -2831,8 +2836,9 @@ and therefore there is no possibility of premature garbage collection. In practi

    -The premature garbage collection prevention parameter for proxy classes is generated by default. -It does impose a slight overhead and can be suppressed by specifying the 'nopgcpp' attribute in the "jnitype" Java typemap. +The premature garbage collection prevention parameter for proxy classes is generated by default whenever proxy classes are passed by value, reference or with a pointer. +The additional parameters do impose a slight performance overhead and the parameter generation can be suppressed globally with the -nopgcpp commandline option. +More selective suppression is possible with the 'nopgcpp' attribute in the "jnitype" Java typemap. The attribute is a flag and so should be set to "1" to enable the suppression, or it can be omitted or set to "0" to disable. For example:

    diff --git a/Source/Modules/java.cxx b/Source/Modules/java.cxx index 75204f006..96051c150 100644 --- a/Source/Modules/java.cxx +++ b/Source/Modules/java.cxx @@ -34,6 +34,7 @@ class JAVA : public Language { List *filenames_list; bool proxy_flag; // Flag for generating proxy classes + bool nopgcpp_flag; // Flag for suppressing the premature garbage collection prevention parameter bool native_function_flag; // Flag for when wrapping a native function bool enum_constant_flag; // Flag for when wrapping an enum or constant bool static_flag; // Flag for when wrapping a static functions or member variables @@ -102,6 +103,7 @@ class JAVA : public Language { filenames_list(NULL), proxy_flag(true), + nopgcpp_flag(false), native_function_flag(false), enum_constant_flag(false), static_flag(false), @@ -221,6 +223,9 @@ class JAVA : public Language { } else if ((strcmp(argv[i],"-noproxy") == 0)) { Swig_mark_arg(i); proxy_flag = false; + } else if (strcmp(argv[i],"-nopgcpp") == 0) { + Swig_mark_arg(i); + nopgcpp_flag = true; } else if (strcmp(argv[i],"-oldvarnames") == 0) { Swig_mark_arg(i); old_variable_names = true; @@ -2784,7 +2789,7 @@ class JAVA : public Language { if (Cmp(jtype, "long") == 0) { if (proxy_flag) { Node *n = classLookup(t); - if (n && !GetFlag(p, "tmap:jtype:nopgcpp")) { + if (n && !GetFlag(p, "tmap:jtype:nopgcpp") && !nopgcpp_flag) { return Getattr(n,"sym:name"); } } @@ -3936,9 +3941,10 @@ extern "C" Language * swig_java(void) { const char *JAVA::usage = (char*)"\ Java Options (available with -java)\n\ - -package - set name of the Java package to \n\ + -nopgcpp - Suppress premature garbage collection prevention parameter\n\ -noproxy - Generate the low-level functional interface instead\n\ of proxy classes\n\ -oldvarnames - old intermediary method names for variable wrappers\n\ + -package - set name of the Java package to \n\ \n";