1 /* Copyright (C) 2010,2017 Matthew Fluet.
2 * Copyright (C) 1999-2008 Henry Cejtin, Matthew Fluet, Suresh
3 * Jagannathan, and Stephen Weeks.
4 * Copyright (C) 1997-2000 NEC Research Institute.
6 * MLton is released under a BSD-style license.
7 * See the file MLton-LICENSE for details.
10 void *GC_mmapAnon_safe (void *p
, size_t length
) {
13 result
= GC_mmapAnon (p
, length
);
14 if ((void*)-1 == result
) {
16 die ("Out of memory. Unable to allocate %s bytes.\n",
17 uintmaxToCommaString(length
));
22 static inline void GC_memcpy (pointer src
, pointer dst
, size_t size
) {
24 fprintf (stderr
, "GC_memcpy ("FMTPTR
", "FMTPTR
", %"PRIuMAX
")\n",
25 (uintptr_t)src
, (uintptr_t)dst
, (uintmax_t)size
);
26 assert (! (src
<= dst
and dst
< src
+ size
));
27 assert (! (dst
<= src
and src
< dst
+ size
));
28 memcpy (dst
, src
, size
);
31 static inline void GC_memmove (pointer src
, pointer dst
, size_t size
) {
33 fprintf (stderr
, "GC_memmove ("FMTPTR
", "FMTPTR
", %"PRIuMAX
")\n",
34 (uintptr_t)src
, (uintptr_t)dst
, (uintmax_t)size
);
37 memmove (dst
, src
, size
);