mirror of
https://github.com/corda/corda.git
synced 2025-01-23 04:48:09 +00:00
6f1d02dae7
The trick is to make all destructors non-virtual. This is safe because we never use the delete operator, which is the only case where virtual destructors are relevant. This is a better solution than implementing our own delete operator, because we want libraries loaded at runtime to use the libstdc++ version, not ours.
28 lines
642 B
C++
28 lines
642 B
C++
/* Copyright (c) 2008, Avian Contributors
|
|
|
|
Permission to use, copy, modify, and/or distribute this software
|
|
for any purpose with or without fee is hereby granted, provided
|
|
that the above copyright notice and this permission notice appear
|
|
in all copies.
|
|
|
|
There is NO WARRANTY for this software. See license.txt for
|
|
details. */
|
|
|
|
#ifndef ALLOCATOR_H
|
|
#define ALLOCATOR_H
|
|
|
|
#include "common.h"
|
|
|
|
namespace vm {
|
|
|
|
class Allocator {
|
|
public:
|
|
virtual void* tryAllocate(unsigned size) = 0;
|
|
virtual void* allocate(unsigned size) = 0;
|
|
virtual void free(const void* p, unsigned size) = 0;
|
|
};
|
|
|
|
} // namespace vm
|
|
|
|
#endif//ALLOCATOR_H
|