diff --git a/Doc/Manual/CSharp.html b/Doc/Manual/CSharp.html index 487167cce..452f7fd7c 100644 --- a/Doc/Manual/CSharp.html +++ b/Doc/Manual/CSharp.html @@ -431,7 +431,7 @@ Please refer to this section for details, but for convenience, the C# usage for
For the %array_functions example, the equivalent usage would be: -
+
@@ -445,7 +445,7 @@ example.delete_doubleArray(a); // Destroy arrayand for the %array_class example, the equivalent usage would be: -
+
@@ -485,18 +485,17 @@ on MSDN.The P/Invoke default marshalling is supported by the arrays_csharp.i library via the INPUT, OUTPUT and INOUT typemaps. Let's look at some example usage. Consider the following C function: +
-void myArrayCopy(int *sourceArray, int *targetArray, int nitems);We can now instruct SWIG to use the default marshalling typemaps by
-
-%include "arrays_csharp.i" @@ -505,13 +504,11 @@ We can now instruct SWIG to use the default marshalling typemaps by %apply int OUTPUT[] {int *targetArray}As a result, we get the following method in the module class:
-
-public static void myArrayCopy(int[] sourceArray, int[] targetArray, int nitems) { @@ -519,7 +516,6 @@ public static void myArrayCopy(int[] sourceArray, int[] targetArray, int nitems) }If we look beneath the surface at the corresponding intermediary class code, we see @@ -528,7 +524,6 @@ that SWIG has generated code that uses attributes marshalling for the arrays:
-
-[DllImport("example", EntryPoint="CSharp_myArrayCopy")] @@ -536,7 +531,6 @@ public static extern void myArrayCopy([In, MarshalAs(UnmanagedType.LPArray)]int[ [Out, MarshalAs(UnmanagedType.LPArray)]int[] jarg2, int jarg3);As an example of passing an inout array (i.e. the target function will both read from and @@ -544,19 +538,16 @@ write to the array), consider this C function that swaps a given number of eleme in the given arrays:
-
-void myArraySwap(int *array1, int *array2, int nitems);Now, we can instruct SWIG to wrap this by
-
-%include "arrays_csharp.i" @@ -565,13 +556,11 @@ Now, we can instruct SWIG to wrap this by %apply int INOUT[] {int *array2}This results in the module class method
-
-public static void myArraySwap(int[] array1, int[] array2, int nitems) { @@ -579,13 +568,11 @@ This results in the module class method }and intermediate class method
-
-[DllImport("example", EntryPoint="CSharp_myArraySwap")] @@ -593,7 +580,6 @@ and intermediate class method [In, Out, MarshalAs(UnmanagedType.LPArray)]int[] jarg2, int jarg3);17.3.3 Managed arrays using pinning
@@ -629,19 +615,16 @@ void myArrayCopy(int *sourceArray, int *targetArray, int nitems); We now need to declare the module class method unsafe, as we are using pointers: -
-%csmethodmodifiers myArrayCopy "public unsafe";Apply the appropriate typemaps to the array parameters:
-
-%include "arrays_csharp.i" @@ -650,7 +633,6 @@ Apply the appropriate typemaps to the array parameters: %apply int FIXED[] {int *targetArray}Notice that there is no need for separate in, out or inout typemaps as is the @@ -661,7 +643,6 @@ case when using P/Invoke default marshalling. As a result, we get the following method in the module class:
-
-public unsafe static void myArrayCopy(int[] sourceArray, int[] targetArray, int nitems) { @@ -675,7 +656,6 @@ As a result, we get the following method in the module class: }On the method signature level the only difference to the version using P/Invoke default @@ -687,14 +667,12 @@ Also the intermediate class method looks a little different from the default mar example - the method is expecting an IntPtr as the parameter type.
-
- diff --git a/Doc/Manual/Java.html b/Doc/Manual/Java.html index 99e7f6c59..60bca1262 100644 --- a/Doc/Manual/Java.html +++ b/Doc/Manual/Java.html @@ -2858,7 +2858,7 @@ and therefore there is no possibility of premature garbage collection. In practi[DllImport("example", EntryPoint="CSharp_myArrayCopy")] public static extern void myArrayCopy(IntPtr jarg1, IntPtr jarg2, int jarg3);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 implementation for this extra parameter generation requires the "jtype" typemap to contain long and the "jstype" typemap to contain the name of a proxy class. -
+
The additional parameter does impose a slight performance overhead and the parameter generation can be suppressed globally with the -nopgcpp commandline option. diff --git a/Doc/Manual/Modules.html b/Doc/Manual/Modules.html index 9b8fd85e5..5ac66dc2e 100644 --- a/Doc/Manual/Modules.html +++ b/Doc/Manual/Modules.html @@ -132,7 +132,7 @@ in base_module.i as well as the %import in derived_module. Another issue to beware of is that multiple dependent wrappers should not be linked/loaded in parallel from multiple threads as SWIG provides no locking - for more on that -issue, read on.
+issue, read on.15.2 The SWIG runtime code