Files
IoTManager/lib/ArduinoStreamUtils/src/StreamUtils/Ports/DefaultAllocator.hpp

21 lines
356 B
C++
Raw Normal View History

2021-12-13 00:58:42 +01:00
// StreamUtils - github.com/bblanchon/ArduinoStreamUtils
// Copyright Benoit Blanchon 2019-2021
// MIT License
#pragma once
namespace StreamUtils {
#include <stdlib.h> // malloc, free, size_t
struct DefaultAllocator {
void* allocate(size_t n) {
return malloc(n);
}
void deallocate(void* p) {
free(p);
}
};
} // namespace StreamUtils