X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=mono%2Futils%2Fmono-mmap.h;h=69cad338fef91b346fd2eb75f80733d88ad6f5bb;hb=7ee959e4185136e22348ee43d76426331e2fc237;hp=109419e8ca9fda0615cd156d92e7bc829bbdaa3a;hpb=434e59e4bc6cda7d62ad6725a8b5a590ff9c9d1f;p=mono.git diff --git a/mono/utils/mono-mmap.h b/mono/utils/mono-mmap.h index 109419e8ca9..69cad338fef 100644 --- a/mono/utils/mono-mmap.h +++ b/mono/utils/mono-mmap.h @@ -19,6 +19,16 @@ enum { MONO_MMAP_32BIT = 1 << 8 }; +/* + * A simple interface to fopen/fstat/fileno + */ +typedef struct _MonoFileMap MonoFileMap; + +MonoFileMap *mono_file_map_open (const char* name); +guint64 mono_file_map_size (MonoFileMap *fmap); +int mono_file_map_fd (MonoFileMap *fmap); +int mono_file_map_close (MonoFileMap *fmap); + int mono_pagesize (void); void* mono_valloc (void *addr, size_t length, int flags); int mono_vfree (void *addr, size_t length); @@ -26,5 +36,21 @@ void* mono_file_map (size_t length, int flags, int fd, guint64 offset, void ** int mono_file_unmap (void *addr, void *handle); int mono_mprotect (void *addr, size_t length, int flags); +void* mono_shared_area (void); +void mono_shared_area_remove (void); +void* mono_shared_area_for_pid (void *pid); +void mono_shared_area_unload (void *area); +int mono_shared_area_instances (void **array, int count); + +/* + * On systems where we have to load code into memory instead of mmaping + * we allow for the allocator to be set. This function is only + * defined on those platforms. + */ +typedef void *(*mono_file_map_alloc_fn) (size_t length); +typedef void (*mono_file_map_release_fn) (void *addr); + +void mono_file_map_set_allocator (mono_file_map_alloc_fn alloc, mono_file_map_release_fn release); + #endif /* __MONO_UTILS_MMAP_H__ */