46 Commits
Author SHA1 Message Date
Thays Grazia 4bdacea237 [embed] Assert when call mono_runtime_object_init (#17589)
* Fix assert when calling externally call mono_runtime_object_init, mono_object_get_domain, mono_string_to_utf8
* Adding samples/embed as unit-test
2019-11-07 11:22:25 -03:00
Johan Lorensson 4f8a82c9fd Upgrade build scripts to support VS2019. (#17269)
Changes will default Windows SDK version as well as Platform Toolset to
the default versions used in the targeted VS version. If the projects are
opened up in VS2015, it should default to Windows SDK 8.1 and v140, but if
the same projects are opened in VS2019, it will default to latest Windows SDK 10
and v142. This way the project files should adapt to used VS version, meaning
that we could still build them using VS2015 (what's currently used on CI) but also
using VS2017 and VS2019. There should not be a need to install any previous versions
of build tools, unless an older version is targeted. It is also possible to set
PlatformToolset when calling msbuild and that should adapt to corresponding default
Windows SDK version for targeted toolset version.

Commit makes many changes and adjustments, aligning all vcxproj files but changes
should not affect build output.
2019-10-17 08:55:50 +02:00
Jan 3132cbd98b Add loading the default Mono configuration file. (#16961)
Add loading the default Mono configuration file.

Add loading the default Mono configuration file in the examples of Mono Embedded.
Also include header in existing usage of `mono_config_parse`.

This fixes problems under Raspbian, when extending the sample with your own code. 

The `teste.c` is still not compiling, because the `mono_set_allocator_vtable` function is not up to date. But I was not able to find the documentation for this function.
2019-09-26 20:46:16 +02:00
Alex Rønne Petersen cbe30987b0 [samples] Clean up the profiler sample and add a simple makefile. 2017-11-23 14:16:03 +01:00
Alex Rønne Petersen a5bc0ce8a0 [profiler] Split method_leave callback into a method_tail_call callback.
With this, profilers can distinguish between the two, and also know what the
target method of a tail call is.

The call instrumentation flags have been renamed accordingly and a new flag has
been added for instrumenting tail calls. I've also added a flag for exceptional
leave events, and method_exception_leave is only raised if this flag is given
for a method.

Also refactored the relevant JIT code a bit so it's easier to follow.
2017-08-07 22:47:55 +02:00
Uri Simchoni e3a57ead2e [profiler] fixes to profiler sample
- Fix the Linux build instructions.
- Remove eglib dependencies, as they complicate the build of an
  extenral module.
- Make instance static instead of heap-allocated.
- Make the call counter 64 bits.
- Adjustments to accommodate the new profiling API.
2017-08-07 06:33:01 +03:00
Alex Rønne Petersen 9ab31d0213 [profiler] Rename mono_profiler_install to mono_profiler_create. 2017-07-20 20:07:47 +02:00
Alex Rønne Petersen 2e449ae199 [profiler] Profiler entry point name must now include the module name.
So mono_profiler_init becomes e.g. mono_profiler_init_log.

This allows us to link together multiple profilers into a single module and
load them selectively. This is especially useful for XA/XI/XM.
2017-07-17 22:45:02 +02:00
Alex Rønne Petersen ea4e4a9ef6 [runtime] New profiler API.
* Profiler callbacks can now be changed and disabled at any point.
* API users no longer have to set event flags. The API instead uses a counter
  internally for each type of callback.
* Filter functions for enter/leave instrumentation can be installed, and they
  can choose whether to instrument the prologue, epilogue, or both.
* Managed allocators can now be instrumented for allocation profiling.
* A profiler must now declare that it wishes to use allocation profiling and/or
  sampling in its init function.
* Sampling parameters can now be changed at any point, and the sampling thread
  can be put into an idle mode when no sampling is needed.
* Only one profiler can have control over the sampling parameters. Whichever
  profiler enables sampling first gets control.
* Adding new events is now very easy: One line in profiler-events.h and one
  line wherever the event should be raised.
* Lifted the restriction that enter/leave instrumentation would cause an abort
  in full AOT mode.
* Support for call chain sampling has been removed.
* Support for the old, platform-specific code coverage mode has been removed.
* The new profiler module entry point is mono_profiler_init. If a module has
  a mono_profiler_startup symbol (the old entry point), a warning will be
  printed and the module won't be loaded.
* Updated the profiler test suite to work with instrumented managed allocators.
2017-07-06 11:32:29 +02:00
Dolphin Hawkins 6474f8e612 Enabled g_mem_set_vtable through the configure option --with-overridable-allocators and exposed through mono_set_allocator_vtable 2016-07-11 13:23:20 -04:00
Zoltan Varga 74527e03dd Remove obsolete interpreter embedding sample. 2015-11-17 02:16:25 -05:00
Alex Rønne Petersen 811674bc63 Merge pull request #1695 from gregoryyoung/master
add compilation instructions
2015-04-09 12:09:53 +02:00
Greg Young 5a228a65a0 add compilation instructions 2015-04-09 13:03:26 +03:00
Zoltan Varga c1ed4a5570 Use AM_CPPFLAGS instead of INCLUDES in Makefile.am files, as the later is no longer supported, see http://lists.gnu.org/archive/html/automake/2012-08/msg00087.html. 2012-10-03 10:26:37 +02:00
Zoltan Varga a457e88362 Remove glib dependencies from the embed samples. Fixes #660117. 2011-01-04 16:38:33 +01:00
Zoltan Varga 32340d1fe2 Remove the unused and incomplete CMake build scripts for now. 2010-11-14 01:21:43 +01:00
Paolo Molaro 9e1f34dd2d Wed Feb 24 15:47:16 CET 2010 Paolo Molaro <[email protected]>
* confiure.in, data/mono-2.pc.in, data/Makefile.am,
	samples/embed/*: increase the API version.


svn path=/trunk/mono/; revision=152356
2010-02-24 15:19:21 +00:00
Zoltan Varga 76a7dbe0ee 2009-06-14 Zoltan Varga <[email protected]>
* samples/CMakeLists.txt: New file, currently empty.

svn path=/trunk/mono/; revision=136079
2009-06-14 15:31:54 +00:00
Martin Baulig 1cbad8abc3 Create .gitignore's.
svn path=/trunk/mono/; revision=128265
2009-02-28 14:36:50 +00:00
Robert Jordan f27859185b memory_usage: add support for MONO_TYPE_STRING.
svn path=/trunk/mono/; revision=89560
2007-11-13 15:05:33 +00:00
Alp Toker c09ffbf3c7 2007-11-10 Alp Toker <[email protected]>
* samples/embed/teste.c: Add a newline at the end of this printf()


svn path=/trunk/mono/; revision=89397
2007-11-10 02:11:19 +00:00
Jonathan Chambers 8e3893279b 2007-03-13 Jonathan Chambers <[email protected]>
* *.vcproj:	Move to msvc directory.
	* *.bat:	Move to msvc directory.
	* libgc/misc.c: Use correct string type for GetModuleHandle. 


svn path=/trunk/mono/; revision=74203
2007-03-13 20:00:05 +00:00
Jonathan Chambers 337b6aedc7 2007-03-13 Jonathan Chambers <[email protected]>
*.vcproj: Fix Release build target, add define to remove CRT warnings, 
	structure output folders a bit better, begin WIN64 port.
	*.bat: Use output from current VS target for executable.
	* icall.c: Fix environ access on windows.
	* gc.h: Fix Win64 typedef.


svn path=/trunk/mono/; revision=74191
2007-03-13 18:08:42 +00:00
Miguel de Icaza 8e24faadcb Add a pre-generated windows configuration file
svn path=/trunk/mono/; revision=68847
2006-12-01 20:53:25 +00:00
Joe Shaw 86d4be5d66 2006-10-13 Joe Shaw <[email protected]>
* samples/size/size.c: Flesh this out quite a bit more so that
	its results are more accurate.
	* samples/size/sample.cs: Add a few more test cases.

svn path=/trunk/mono/; revision=66660
2006-10-13 20:10:55 +00:00
Zoltan Varga ef542a769d 2006-08-31 Zoltan Varga <[email protected]>
* samples/embed/test-invoke.vcproj samples/embed/teste.vcproj: Fix include paths for newer glib versions.

svn path=/trunk/mono/; revision=64632
2006-08-31 16:06:33 +00:00
Miguel de Icaza dbe5a0257c Add support for arrays
svn path=/trunk/mono/; revision=63458
2006-08-07 22:16:58 +00:00
Miguel de Icaza 7dd908635d Add size sample
svn path=/trunk/mono/; revision=63436
2006-08-07 15:56:04 +00:00
Miguel de Icaza 00bfb0443d Add 'size' sample
svn path=/trunk/mono/; revision=63435
2006-08-07 15:55:49 +00:00
Miguel de Icaza c4b5bae7d1 2005-11-09 Miguel de Icaza <[email protected]>
* assembly.c (mono_set_dirs): New API entry point to set the
	assembly and the config directory in one call

A more robust framework for relocation and a public API for embedders to use.


svn path=/trunk/mono/; revision=52816
2005-11-10 02:24:50 +00:00
Miguel de Icaza c6f96ae004 Update sample to load the Mono configuration file
svn path=/trunk/mono/; revision=50597
2005-09-23 17:42:03 +00:00
Sebastien Pouliot 15d731b20a Project files for embedded samples
svn path=/trunk/mono/; revision=45050
2005-05-26 14:59:06 +00:00
Sebastien Pouliot f165dd9a47 Allow compilation using VS.NET
svn path=/trunk/mono/; revision=42352
2005-03-29 18:35:21 +00:00
Ben Maurer 261af5bf28 remove .cvsignore, as this is not used anymore
svn path=/trunk/mono/; revision=40731
2005-02-16 04:43:00 +00:00
Paolo Molaro 11f7e37369 Cleanup examples (removed extra thread execution).
svn path=/trunk/mono/; revision=38700
2005-01-11 14:58:27 +00:00
Paolo Molaro e9969921c0 More embedding samples.
svn path=/trunk/mono/; revision=30034
2004-06-21 13:32:25 +00:00
Paolo Molaro 0e43f1677e Test with metadata-related API sample usage.
svn path=/trunk/mono/; revision=29943
2004-06-19 15:10:45 +00:00
Bernie Solomon db0a332144 2003-12-22 Bernie Solomon <[email protected]>
* samples/embed/testi.c: interpreter embedding example

svn path=/trunk/mono/; revision=21443
2003-12-23 03:49:13 +00:00
Ben Maurer 6421ff5982 .cvsignore update
svn path=/trunk/mono/; revision=17581
2003-08-25 13:38:19 +00:00
Miguel de Icaza fa59896cec Add
svn path=/trunk/mono/; revision=17255
2003-08-11 15:43:00 +00:00
Paolo Molaro c19e0bae31 Bare-bones sample loadable profiler.
svn path=/trunk/mono/; revision=15129
2003-06-05 18:08:01 +00:00
Gonzalo Paniagua Javier 1a453b2403 Fixed compilation of sample
svn path=/trunk/mono/; revision=15093
2003-06-04 04:14:52 +00:00
Dick Porter 9b5c149aec Run all managed code in a subthread. Re-enable GC threaded finalisation.
Fixes bugs 34263 and 31333.

(All tests still behave the same way - 4 fails)

2003-01-23  Dick Porter  <[email protected]>

	* threads.c (start_wrapper): Create a Thread object if needed, so
	the Main() thread can do the class initialisation in a subthread
	that has been set up to allow managed code execution.

	Pass the thread ID instead of the MonoThread pointer to the thread
	start and attach callbacks.  This change is required, because the
	jit thread start callback must be called _before_ the Thread
	object can be created.

	(mono_thread_init): Removed much object creation code that is no
	longer needed.  No managed code is called from here now.

	* object.c (mono_runtime_exec_managed_code): Create a subthread
	for Main, and call back to the runtime to use it.
	Set the exit code when Main exits.

	* gc.c: Make sure domain finalisation happens in a subthread.
	Re-enable threaded GC, fixing bug 31333 (again).

	* environment.c: System.Environment internall calls (so far just
	ExitCode is here, the others are still in icall.c)

	* appdomain.c (mono_runtime_cleanup): All threads running managed
	code should have finished before mono_runtime_cleanup() is
	reached, so no need to clean up threads.


2003-01-23  Dick Porter  <[email protected]>

	* mono.c: Use mono_runtime_exec_managed_code() to run all managed
	code in a subthread.

	* jit.c: Changed thread start and attach callbacks to pass the
	thread ID, not the MonoThread pointer.  Arrange that managed code
	execution will fail an assertion in the main thread, just to be
	sure.


2003-01-23  Dick Porter  <[email protected]>

	* interp.c: Use mono_runtime_exec_managed_code() to run all
	managed code in a subthread.

svn path=/trunk/mono/; revision=10838
2003-01-23 17:46:26 +00:00
Miguel de Icaza b30ff30988 Update sample
svn path=/trunk/mono/; revision=8008
2002-10-05 19:50:44 +00:00
Miguel de Icaza a567b08ca0 sample fix
svn path=/trunk/mono/; revision=5990
2002-07-21 21:50:27 +00:00
Paolo Molaro b51a4fac45 Mono embedding sample.
svn path=/trunk/mono/; revision=5938
2002-07-19 17:24:56 +00:00