Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Formatting changes

svn path=/trunk/mono/; revision=22621
  • Loading branch information...
commit 45fdd8f3bd176a6e8a8da3daddc8cd57b2a71b41 1 parent 9a9d03a
Miguel de Icaza migueldeicaza authored
95 docs/assembly-bundle
... ... @@ -1,42 +1,57 @@
1 1
2   - HOWTO bundle assemblies inside the mono runtime.
3   -
4   -Bundling assemblies inside the mono runtime may be useful for a number
5   -of reasons:
6   - * creating a standalone complete runtime that can be more easily
7   - distributed
8   - * having an application run against a known set of assemblies
9   - that has been tested
10   -
11   -Of course, there are drawbacks, too: if there has been fixes to the assemblies,
12   -replacing them means recompiling the runtime as well and if there are other mono apps,
13   -unless they use the same mono binary, there will be less opportunities for
14   -the operating system to optimize memory usage. So use this feature only
15   -when really needed.
16   -
17   -To bundle a set of assemblies, you need to create a file that lists the assembly
18   -names and the relative files. Empty lines and lines starting with # are ignored:
19   -
20   -== cut cut ==
21   -# Sample bundle template
22   -mscorlib: /path/to/mscorlib/assembly.dll
23   -myapp: /path/to/myapp.exe
24   -== cut cut ==
25   -
26   -Next you need to build the mono runtime using a special configure option:
27   -
28   - ./configure --with-bundle=/path/to/bundle/template
29   -
30   -The path to the template should be an absolute path.
31   -
32   -The script metadata/make-bundle.pl will take the specifie assemblies and embed
33   -them inside the runtime where the loading routines can find them before
34   -searching for them on disk.
35   -
36   -There are still two issues to solve:
37   - * config files: sometimes they are needed but they are not yet bundled
38   - inside the library ()
39   - * building with the included libgc makes it not possible to build a mono
40   - binary statically linked to libmono: this needs to be fixed to make bundles
41   - really useful
  2 + HOWTO bundle assemblies inside the mono runtime.
  3 + Paolo Molaro (lupus@ximian.com)
  4 +
  5 +* Intent
  6 +
  7 + Bundling assemblies inside the mono runtime may be useful for a number
  8 + of reasons:
  9 +
  10 + * creating a standalone complete runtime that can be more easily
  11 + distributed
  12 +
  13 + * having an application run against a known set of assemblies
  14 + that has been tested
  15 +
  16 + Of course, there are drawbacks, too: if there has been fixes
  17 + to the assemblies, replacing them means recompiling the
  18 + runtime as well and if there are other mono apps, unless they
  19 + use the same mono binary, there will be less opportunities for
  20 + the operating system to optimize memory usage. So use this
  21 + feature only when really needed.
  22 +
  23 +* Creating the Bundle
  24 +
  25 + To bundle a set of assemblies, you need to create a file that
  26 + lists the assembly names and the relative files. Empty lines
  27 + and lines starting with # are ignored:
  28 +
  29 + == cut cut ==
  30 + # Sample bundle template
  31 + mscorlib: /path/to/mscorlib/assembly.dll
  32 + myapp: /path/to/myapp.exe
  33 + == cut cut ==
  34 +
  35 + Next you need to build the mono runtime using a special configure option:
  36 +
  37 + ./configure --with-bundle=/path/to/bundle/template
  38 +
  39 + The path to the template should be an absolute path.
  40 +
  41 + The script metadata/make-bundle.pl will take the specifie
  42 + assemblies and embed them inside the runtime where the loading
  43 + routines can find them before searching for them on disk.
  44 +
  45 +* Open Issues
  46 +
  47 + There are still two issues to solve:
  48 +
  49 + * config files: sometimes they are needed but they are
  50 + not yet bundled inside the library ()
  51 +
  52 + * building with the included libgc makes it not
  53 + possible to build a mono binary statically linked to
  54 + libmono: this needs to be fixed to make bundles
  55 + really useful.
  56 +
42 57
4 docs/embedded-api
... ... @@ -1,7 +1,7 @@
1 1
2 2 Embedding the Mono runtime, preliminary version
3   -
4   - Miguel de Icaza, Paolo Molaro.
  3 + Miguel de Icaza (miguel@ximian.com),
  4 + Paolo Molaro (lupus@ximian.com)
5 5
6 6 This document describes how to embed the Mono runtime in your
7 7 application, and how to invoke CIL methods from C, and how to
5 docs/exceptions
... ... @@ -1,5 +1,6 @@
1   -Author: Dietmar Maurer (dietmar@ximian.com)
2   -(C) 2001 Ximian, Inc.
  1 + Exception Implementation in the Mono Runtime
  2 + Dietmar Maurer (dietmar@ximian.com)
  3 + (C) 2001 Ximian, Inc.
3 4
4 5 Exception implementation (jit):
5 6 ===============================
81 docs/internal-calls
... ... @@ -1,7 +1,19 @@
  1 + Internal Call Topics
1 2
2   -* How to map C# types for use in the C implementation of internal calls
  3 +* Introduction
  4 +
  5 + The Common Language Infrastructure allows for methods to be
  6 + implemented in unmanaged code. Unlike the Platform Invocation
  7 + services which provide marshalling and unmarshalling of data
  8 + from managed to unmanaged and viceversa the Internal calls do
  9 + not perform any kind of marshalling.
  10 +
  11 +* Basic Type mapping
  12 +
  13 + The following lists how the C# types are exposed to the C API.
3 14
4 15 C# type C type
  16 + -----------------------------
5 17 char gunichar2
6 18 bool MonoBoolean
7 19 sbyte signed char
@@ -16,44 +28,57 @@
16 28 object MonoObject*
17 29 string MonoString*
18 30
19   -For ref and out paramaters you'll use the corresponding pointer type.
20   -Arrays of any type must be described with a MonoArray* and the elements
21   -must be accessed with the mono_array_* macros.
22   -Any other type that has a matching C structure representation, should use
23   -a pointer to the struct instead of a generic MonoObject pointer.
  31 +* Pointers
24 32
25   -Instance methods that are internal calls will receive as first argument
26   -the instance object, so you must account for it in the C method signature:
  33 + For ref and out paramaters you'll use the corresponding
  34 + pointer type.
27 35
28   - [MethodImplAttribute(MethodImplOptions.InternalCall)]
29   - public extern override int GetHashCode ();
  36 + So if you have a C# type listed as "ref int", you should use
  37 + "int *" in your implementation.
30 38
31   -becaomes:
  39 +* Arrays
32 40
33   - gint32 ves_icall_System_String_GetHashCode (MonoString *this);
  41 + Arrays of any type must be described with a MonoArray* and the
  42 + elements must be accessed with the mono_array_* macros.
34 43
  44 +* Other Structures
35 45
  46 + Any other type that has a matching C structure representation,
  47 + should use a pointer to the struct instead of a generic
  48 + MonoObject pointer.
36 49
37   -* How to hook internal calls with the runtime
38   -
39   -Once you require an internal call in corlib, you need to create a C
40   -implementation for it and register it in a static table in metadata/icall.c.
41   -Add an entry in the table like:
  50 +* Instance Methods.
42 51
43   - "System.String::GetHashCode", ves_icall_System_String_GetHashCode,
  52 + Instance methods that are internal calls will receive as first argument
  53 + the instance object, so you must account for it in the C method signature:
44 54
45   -Note that you need to include the full namespace.name of the class.
46   -If there are overloaded methods, you need also to specify the signature
47   -of _all_ of them:
  55 + [MethodImplAttribute(MethodImplOptions.InternalCall)]
  56 + public extern override int GetHashCode ();
48 57
49   - [MethodImplAttribute(MethodImplOptions.InternalCall)]
50   - public extern override void DoSomething ();
51   - [MethodImplAttribute(MethodImplOptions.InternalCall)]
52   - public extern override void DoSomething (bool useful);
  58 + becomes:
53 59
54   -should be mapped with:
  60 + gint32 ves_icall_System_String_GetHashCode (MonoString *this);
55 61
56   - "Namespace.ClassName::DoSomething()", ves_icall_Namespace_ClassName_DoSomething,
57   - "Namespace.ClassName::DoSomething(bool)", ves_icall_Namespace_ClassName_DoSomething_bool,
  62 +* How to hook internal calls with the runtime
58 63
  64 + Once you require an internal call in corlib, you need to
  65 + create a C implementation for it and register it in a static
  66 + table in metadata/icall.c. Add an entry in the table like:
  67 +
  68 + "System.String::GetHashCode", ves_icall_System_String_GetHashCode,
  69 +
  70 + Note that you need to include the full namespace.name of the
  71 + class. If there are overloaded methods, you need also to
  72 + specify the signature of _all_ of them:
  73 +
  74 + [MethodImplAttribute(MethodImplOptions.InternalCall)]
  75 + public extern override void DoSomething ();
  76 + [MethodImplAttribute(MethodImplOptions.InternalCall)]
  77 + public extern override void DoSomething (bool useful);
  78 +
  79 + should be mapped with:
  80 +
  81 + "Namespace.ClassName::DoSomething()", ves_icall_Namespace_ClassName_DoSomething,
  82 + "Namespace.ClassName::DoSomething(bool)", ves_icall_Namespace_ClassName_DoSomething_bool,
  83 +
59 84

0 comments on commit 45fdd8f

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