blob: 06d11f4465311352969039f71d8287ee57ed8d04 [file] [log] [blame]
Austin Schuh40485ed2019-10-26 21:51:44 -07001#include "aos/flatbuffers.h"
2
3#include "glog/logging.h"
4
5namespace aos {
6
7uint8_t *FixedAllocatorBase::allocate(size_t) {
8 if (is_allocated_) {
Austin Schuh3da7b272020-01-06 18:41:40 -08009 LOG(FATAL) << "Can't allocate more memory with a fixed size allocator. "
10 "Increase the memory reserved.";
Austin Schuh40485ed2019-10-26 21:51:44 -070011 }
12
13 is_allocated_ = true;
14 return data();
15}
16
17uint8_t *FixedAllocatorBase::reallocate_downward(uint8_t *, size_t, size_t,
18 size_t, size_t) {
Austin Schuh3da7b272020-01-06 18:41:40 -080019 LOG(FATAL) << "Can't allocate more memory with a fixed size allocator. "
20 "Increase the memory reserved.";
Austin Schuh40485ed2019-10-26 21:51:44 -070021 return nullptr;
22}
23
24} // namespace aos