NEWDEL.CPP 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. /*
  2. ** Command & Conquer Red Alert(tm)
  3. ** Copyright 2025 Electronic Arts Inc.
  4. **
  5. ** This program is free software: you can redistribute it and/or modify
  6. ** it under the terms of the GNU General Public License as published by
  7. ** the Free Software Foundation, either version 3 of the License, or
  8. ** (at your option) any later version.
  9. **
  10. ** This program is distributed in the hope that it will be useful,
  11. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ** GNU General Public License for more details.
  14. **
  15. ** You should have received a copy of the GNU General Public License
  16. ** along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. /***************************************************************************
  19. ** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S **
  20. ***************************************************************************
  21. * *
  22. * Project Name : Memory system. *
  23. * *
  24. * File Name : NEWDEL.CPP *
  25. * *
  26. * Programmer : Scott K. Bowen *
  27. * *
  28. * Start Date : June 21, 1994 *
  29. * *
  30. * Last Update : October 20, 1994 [SKB] *
  31. * *
  32. *-------------------------------------------------------------------------*
  33. * Functions: *
  34. * operator NEW -- Overides the global new function. *
  35. * operator delete -- Overides the global delete function. *
  36. * operator NEW[] -- Overides the array version of new. *
  37. * operator delete[] -- Overides the array version of delete[] *
  38. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  39. #include "wwmem.h"
  40. /*=========================================================================*/
  41. /* The following PRIVATE functions are in this file: */
  42. /*=========================================================================*/
  43. /*= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =*/
  44. /***************************************************************************
  45. * OPERATOR NEW -- Overides the global new function. *
  46. * *
  47. * INPUT: *
  48. * *
  49. * OUTPUT: *
  50. * *
  51. * WARNINGS: *
  52. * *
  53. * HISTORY: *
  54. * 06/21/1994 SKB : Created. *
  55. *=========================================================================*/
  56. void * operator new(size_t size)
  57. {
  58. return (Alloc((unsigned long) size, MEM_NEW));
  59. }
  60. /***************************************************************************
  61. * OPERATOR NEW[] -- Overides the array version of new. *
  62. * *
  63. * *
  64. * *
  65. * INPUT: *
  66. * *
  67. * OUTPUT: *
  68. * *
  69. * WARNINGS: *
  70. * *
  71. * HISTORY: *
  72. * 06/21/1994 SKB : Created. *
  73. *=========================================================================*/
  74. void * operator new[](size_t size)
  75. {
  76. return (Alloc((unsigned long) size, MEM_NEW));
  77. }
  78. /***************************************************************************
  79. * OPERATOR DELETE -- Overides the global delete function. *
  80. * *
  81. * *
  82. * *
  83. * INPUT: *
  84. * *
  85. * OUTPUT: *
  86. * *
  87. * WARNINGS: *
  88. * *
  89. * HISTORY: *
  90. * 06/21/1994 SKB : Created. *
  91. *=========================================================================*/
  92. void operator delete(void *ptr)
  93. {
  94. Free(ptr);
  95. }
  96. /***************************************************************************
  97. * OPERATOR DELETE[] -- Overides the array version of delete[] *
  98. * *
  99. * *
  100. * *
  101. * INPUT: *
  102. * *
  103. * OUTPUT: *
  104. * *
  105. * WARNINGS: *
  106. * *
  107. * HISTORY: *
  108. * 10/20/1994 SKB : Created. *
  109. *=========================================================================*/
  110. void operator delete[](void *ptr)
  111. {
  112. Free(ptr);
  113. }