+Mon Oct 13 11:00:49 CEST 2008 Paolo Molaro <lupus@ximian.com>
+
+ * domain.c, assembly.c, debug-mono-symfile.c, debug-mono-symfile.h,
+ monosn.c, Makefile.am, pedump.c, image.c, metadata-internals.h,
+ reflection.c: remove rawbuffer usage: mmap support is more sanely
+ provided by utils/mono-mmap.
+
Sat Oct 11 19:46:19 CEST 2008 Paolo Molaro <lupus@ximian.com>
* gc.c: use posix semaphores when possible so that
mono-endian.c \
mono-endian.h \
mono-config.c \
- rawbuffer.c \
- rawbuffer.h \
loader.c \
class.c \
class-internals.h \
#include <stdlib.h>
#include "assembly.h"
#include "image.h"
-#include "rawbuffer.h"
#include "object-internals.h"
#include <mono/metadata/loader.h>
#include <mono/metadata/tabledefs.h>
#include <sys/stat.h>
#include <mono/metadata/metadata.h>
#include <mono/metadata/tabledefs.h>
-#include <mono/metadata/rawbuffer.h>
#include <mono/metadata/tokentype.h>
#include <mono/metadata/appdomain.h>
#include <mono/metadata/exception.h>
#include <mono/metadata/mono-endian.h>
#include <mono/metadata/metadata-internals.h>
#include <mono/metadata/class-internals.h>
+#include <mono/utils/mono-mmap.h>
#include <fcntl.h>
#ifdef HAVE_UNISTD_H
symfile->filename, g_strerror (errno));
} else {
symfile->raw_contents_size = stat_buf.st_size;
- symfile->raw_contents = mono_raw_buffer_load (fileno (f), FALSE, 0, stat_buf.st_size);
+ symfile->raw_contents = mono_file_map (stat_buf.st_size, MONO_MMAP_READ|MONO_MMAP_PRIVATE, fileno (f), 0, &symfile->raw_contents_handle);
}
fclose (f);
g_hash_table_destroy (symfile->method_hash);
if (symfile->raw_contents)
- mono_raw_buffer_free ((gpointer) symfile->raw_contents);
+ mono_file_unmap ((gpointer) symfile->raw_contents, symfile->raw_contents_handle);
if (symfile->filename)
g_free (symfile->filename);
struct _MonoSymbolFile {
const guint8 *raw_contents;
int raw_contents_size;
+ void *raw_contents_handle;
int major_version;
int minor_version;
gchar *filename;
#include <mono/metadata/class-internals.h>
#include <mono/metadata/assembly.h>
#include <mono/metadata/exception.h>
-#include <mono/metadata/rawbuffer.h>
#include <mono/metadata/metadata-internals.h>
#include <mono/metadata/gc-internal.h>
#include <mono/metadata/appdomain.h>
InitializeCriticalSection (&appdomains_mutex);
mono_metadata_init ();
- mono_raw_buffer_init ();
mono_images_init ();
mono_assemblies_init ();
mono_classes_init ();
mono_assemblies_cleanup ();
mono_images_cleanup ();
mono_debug_cleanup ();
- mono_raw_buffer_cleanup ();
mono_metadata_cleanup ();
TlsFree (appdomain_thread_id);
#include <string.h>
#include "image.h"
#include "cil-coff.h"
-#include "rawbuffer.h"
#include "mono-endian.h"
#include "tabledefs.h"
#include "tokentype.h"
#include <mono/io-layer/io-layer.h>
#include <mono/utils/mono-logger.h>
#include <mono/utils/mono-path.h>
+#include <mono/utils/mono-mmap.h>
#include <mono/utils/mono-io-portability.h>
#include <mono/metadata/class-internals.h>
#include <mono/metadata/assembly.h>
image = g_new0 (MonoImage, 1);
image->raw_buffer_used = TRUE;
image->raw_data_len = stat_buf.st_size;
- image->raw_data = mono_raw_buffer_load (fileno (filed), FALSE, 0, stat_buf.st_size);
+ image->raw_data = mono_file_map (stat_buf.st_size, MONO_MMAP_READ|MONO_MMAP_PRIVATE, fileno (filed), 0, &image->raw_data_handle);
iinfo = g_new0 (MonoCLIImageInfo, 1);
image->image_info = iinfo;
image->name = mono_path_resolve_symlinks (fname);
if (image->raw_buffer_used) {
if (image->raw_data != NULL)
- mono_raw_buffer_free (image->raw_data);
+ mono_file_unmap (image->raw_data, image->raw_data_handle);
}
if (image->raw_data_allocated) {
* this image between calls of mono_image_open () and mono_image_close ().
*/
int ref_count;
+ void *raw_data_handle;
char *raw_data;
guint32 raw_data_len;
guint8 raw_buffer_used : 1;
guint32 len;
mono_metadata_init ();
- mono_raw_buffer_init ();
mono_images_init ();
mono_assemblies_init ();
mono_loader_init ();
#include <mono/metadata/appdomain.h>
#include <mono/metadata/assembly.h>
#include <mono/metadata/metadata-internals.h>
-#include <mono/metadata/rawbuffer.h>
#include <mono/metadata/class-internals.h>
#include <mono/metadata/verify-internals.h>
#include "mono/utils/mono-digest.h"
usage ();
mono_metadata_init ();
- mono_raw_buffer_init ();
mono_images_init ();
mono_assemblies_init ();
mono_loader_init ();
#include <ctype.h>
#include "image.h"
#include "cil-coff.h"
-#include "rawbuffer.h"
#include "mono-endian.h"
#include <mono/metadata/gc-internal.h>
#include <mono/metadata/mempool-internals.h>