aboutsummaryrefslogtreecommitdiffstats
path: root/vespamalloc/src/vespamalloc/malloc/mallocdst16.cpp
blob: 3869e9c9df30a36d36502cb5e67d668b6647ece4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include <vespamalloc/malloc/mallocdst.h>

namespace vespamalloc {

static Allocator * createAllocator()
{
    if (_GmemP == NULL) {
        _GmemP = new (_Gmem) Allocator(1, 0x200000);
    }
    return _GmemP;
}

class DumpAtEnd
{
public:
    ~DumpAtEnd();
};

DumpAtEnd::~DumpAtEnd()
{
    fprintf(stderr, "mallocdst dumping at end\n");
    _GmemP->info(stderr, 2);
}

static DumpAtEnd _Gdumper;

template void MemBlockBoundsCheckBaseT<20, 16>::dumpInfo(size_t);

}

extern "C" {

int is_vespamallocdst16() __attribute__((visibility ("default")));
int is_vespamallocdst16() { return 1; }

}
#include <vespamalloc/malloc/overload.h>