General Purpose library for Freestanding C++ and POSIX systems
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 regels
486 B

4 jaren geleden
4 jaren geleden
4 jaren geleden
4 jaren geleden
4 jaren geleden
4 jaren geleden
4 jaren geleden
4 jaren geleden
4 jaren geleden
4 jaren geleden
  1. #pragma once
  2. #include <stddef.h>
  3. #include "gp/allocator/allocator.hpp"
  4. namespace gp {
  5. struct dummy_allocator : public allocator {
  6. /**
  7. * @return nullptr, always
  8. */
  9. virtual void* allocate(size_t)
  10. {
  11. return nullptr;
  12. }
  13. /**
  14. * @return false, always
  15. */
  16. virtual bool deallocate(void*)
  17. {
  18. return false;
  19. }
  20. /**
  21. * @return false, always
  22. */
  23. virtual bool try_reallocate(void*, size_t) {
  24. return false;
  25. }
  26. virtual ~dummy_allocator() = default;
  27. };
  28. }