1 
2 /* Copyright (C) 1999-2019 by The D Language Foundation, All Rights Reserved
3  * http://www.digitalmars.com
4  * Distributed under the Boost Software License, Version 1.0.
5  * http://www.boost.org/LICENSE_1_0.txt
6  * https://github.com/dlang/dmd/blob/master/src/dmd/root/rmem.h
7  */
8 
9 #pragma once
10 
11 #include "dsystem.h"    // for size_t
12 
13 #if __APPLE__ && __i386__
14     /* size_t is 'unsigned long', which makes it mangle differently
15      * than D's 'uint'
16      */
17     typedef unsigned d_size_t;
18 #else
19     typedef size_t d_size_t;
20 #endif
21 
22 struct Mem
23 {
MemMem24     Mem() { }
25 
26     static char *xstrdup(const char *s);
27     static void *xmalloc(d_size_t size);
28     static void *xcalloc(d_size_t size, d_size_t n);
29     static void *xrealloc(void *p, d_size_t size);
30     static void xfree(void *p);
31     static void *xmallocdup(void *o, d_size_t size);
32     static void error();
33 };
34 
35 extern Mem mem;
36