| 1 |
|
| 2 |
/* Copyright (C) 1999-2025 by The D Language Foundation, All Rights Reserved |
| 3 |
* written by Walter Bright |
| 4 |
* https://www.digitalmars.com |
| 5 |
* Distributed under the Boost Software License, Version 1.0. |
| 6 |
* https://www.boost.org/LICENSE_1_0.txt |
| 7 |
* https://github.com/dlang/dmd/blob/master/src/dmd/root/rmem.h |
| 8 |
*/ |
| 9 |
|
| 10 |
#pragma once |
| 11 |
|
| 12 |
#include "dcompat.h" // for d_size_t |
| 13 |
|
| 14 |
struct Mem |
| 15 |
{ |
| 16 |
Mem() { } |
| 17 |
|
| 18 |
static char *xstrdup(const char *s); |
| 19 |
static void xfree(void *p); |
| 20 |
static void *xmalloc(d_size_t size); |
| 21 |
static void *xcalloc(d_size_t size, d_size_t n); |
| 22 |
static void *xrealloc(void *p, d_size_t size); |
| 23 |
static void error(); |
| 24 |
|
| 25 |
static bool _isGCEnabled; |
| 26 |
|
| 27 |
static bool isGCEnabled(); |
| 28 |
static void disableGC(); |
| 29 |
static void addRange(const void *p, d_size_t size); |
| 30 |
static void removeRange(const void *p); |
| 31 |
}; |
| 32 |
|
| 33 |
extern Mem mem; |