corda/src/allocator.h
Joel Dice 6f1d02dae7 remove the libstdc++ dependency once and for all
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.
2008-10-28 15:40:50 -06:00

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