aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/sys/common/erl_mmap.h
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2015-09-02 18:35:29 +0200
committerRickard Green <[email protected]>2015-11-12 15:25:46 +0100
commit63466c5522ed58b6e73e35dc29c7c7584f073768 (patch)
treed90a663072c40e31b82597dbeb19745ba15fc631 /erts/emulator/sys/common/erl_mmap.h
parentada8342bedf8d4b84d4c3c10fcfc7919e532fd8c (diff)
downloadotp-63466c5522ed58b6e73e35dc29c7c7584f073768.tar.gz
otp-63466c5522ed58b6e73e35dc29c7c7584f073768.tar.bz2
otp-63466c5522ed58b6e73e35dc29c7c7584f073768.zip
erts: Refactor erl_mmap to allow several mapper instances
Diffstat (limited to 'erts/emulator/sys/common/erl_mmap.h')
-rw-r--r--erts/emulator/sys/common/erl_mmap.h19
1 files changed, 11 insertions, 8 deletions
diff --git a/erts/emulator/sys/common/erl_mmap.h b/erts/emulator/sys/common/erl_mmap.h
index 51f830d045..8707c23527 100644
--- a/erts/emulator/sys/common/erl_mmap.h
+++ b/erts/emulator/sys/common/erl_mmap.h
@@ -50,23 +50,26 @@ typedef struct {
#define ERTS_MMAP_INIT_DEFAULT_INITER \
{{NULL, NULL}, {NULL, NULL}, 0, 1, (1 << 16), 1}
-void *erts_mmap(Uint32 flags, UWord *sizep);
-void erts_munmap(Uint32 flags, void *ptr, UWord size);
-void *erts_mremap(Uint32 flags, void *ptr, UWord old_size, UWord *sizep);
-int erts_mmap_in_supercarrier(void *ptr);
-void erts_mmap_init(ErtsMMapInit*);
+typedef struct ErtsMemMapper_ ErtsMemMapper;
+extern ErtsMemMapper erts_dflt_mmapper;
+void *erts_mmap(ErtsMemMapper*, Uint32 flags, UWord *sizep);
+void erts_munmap(ErtsMemMapper*, Uint32 flags, void *ptr, UWord size);
+void *erts_mremap(ErtsMemMapper*, Uint32 flags, void *ptr, UWord old_size, UWord *sizep);
+int erts_mmap_in_supercarrier(ErtsMemMapper*, void *ptr);
+void erts_mmap_init(ErtsMemMapper*, ErtsMMapInit*);
struct erts_mmap_info_struct
{
UWord sizes[6];
UWord segs[6];
UWord os_used;
};
-Eterm erts_mmap_info(int *print_to_p, void *print_to_arg,
+Eterm erts_mmap_info(ErtsMemMapper*, int *print_to_p, void *print_to_arg,
Eterm** hpp, Uint* szp, struct erts_mmap_info_struct*);
-Eterm erts_mmap_info_options(char *prefix, int *print_to_p, void *print_to_arg,
+Eterm erts_mmap_info_options(ErtsMemMapper*,
+ char *prefix, int *print_to_p, void *print_to_arg,
Uint **hpp, Uint *szp);
struct process;
-Eterm erts_mmap_debug_info(struct process*);
+Eterm erts_mmap_debug_info(ErtsMemMapper*, struct process*);
#define ERTS_SUPERALIGNED_SIZE \
(1 << ERTS_MMAP_SUPERALIGNED_BITS)