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.

59 lines
1.4 KiB

  1. /* Copyright (c) 2000, 2001, 2003-2006 MySQL AB, 2009 Sun Microsystems, Inc.
  2. Use is subject to license terms.
  3. This program is free software; you can redistribute it and/or modify
  4. it under the terms of the GNU General Public License as published by
  5. the Free Software Foundation; version 2 of the License.
  6. This program is distributed in the hope that it will be useful,
  7. but WITHOUT ANY WARRANTY; without even the implied warranty of
  8. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  9. GNU General Public License for more details.
  10. You should have received a copy of the GNU General Public License
  11. along with this program; if not, write to the Free Software
  12. Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
  13. /*
  14. This is a replacement of new/delete operators to be used when compiling
  15. with gcc 3.0.x to avoid including libstdc++
  16. */
  17. #include "mysys_priv.h"
  18. #ifdef USE_MYSYS_NEW
  19. void *operator new (size_t sz)
  20. {
  21. return (void *) malloc (sz ? sz : 1);
  22. }
  23. void *operator new[] (size_t sz)
  24. {
  25. return (void *) malloc (sz ? sz : 1);
  26. }
  27. void operator delete (void *ptr)
  28. {
  29. if (ptr)
  30. free(ptr);
  31. }
  32. void operator delete[] (void *ptr) throw ()
  33. {
  34. if (ptr)
  35. free(ptr);
  36. }
  37. C_MODE_START
  38. int __cxa_pure_virtual()
  39. {
  40. assert(! "Aborted: pure virtual method called.");
  41. return 0;
  42. }
  43. C_MODE_END
  44. #endif /* USE_MYSYS_NEW */