New.cpp 667 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #include "utils/New.hpp"
  2. #include <stdlib.h>
  3. void* operator new(size_t bytes) noexcept {
  4. return malloc(bytes);
  5. }
  6. void* operator new[](size_t bytes) noexcept {
  7. return malloc(bytes);
  8. }
  9. void operator delete(void* p) noexcept {
  10. free(p);
  11. }
  12. void operator delete[](void* p) noexcept {
  13. free(p);
  14. }
  15. void operator delete(void* p, size_t bytes) noexcept {
  16. (void)bytes;
  17. free(p);
  18. }
  19. void operator delete[](void* p, size_t bytes) noexcept {
  20. (void)bytes;
  21. free(p);
  22. }
  23. void* operator new(size_t bytes, void* p) noexcept {
  24. (void)bytes;
  25. return p;
  26. }
  27. /*void* operator new[](size_t bytes, void* p) noexcept {
  28. (void)bytes;
  29. return p;
  30. }*/