source: git/Singular/mmalloc.cc @ 584f84d

spielwiese
Last change on this file since 584f84d was 558fb3c, checked in by Hans Schönemann <hannes@…>, 23 years ago
*hannes: C/C++ differences (found on SUN) git-svn-id: file:///usr/local/Singular/svn/trunk@4739 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 780 bytes
Line 
1/****************************************
2*  Computer Algebra System SINGULAR     *
3****************************************/
4/* $Id: mmalloc.cc,v 1.2 2000-11-20 10:18:55 hannes Exp $ */
5/*
6* ABSTRACT: standard version of C++-memory management alloc func
7*/
8#include <stdlib.h>
9
10#include "mod2.h"
11
12#include <omalloc.h>
13
14/* We define those, so that our values of
15   OM_TRACK and OM_CHECK are used  */
16
17void* operator new ( size_t size )
18{
19  void* addr;
20  if (!size) size = 1;
21  omTypeAlloc(void*, addr, size);
22  return addr;
23}
24
25void operator delete ( void* block )
26{
27  omfree( block );
28}
29
30void* operator new[] ( size_t size )
31{
32  void* addr;
33  if (! size) size = 1;
34  omTypeAlloc(void*, addr, size);
35  return addr;
36}
37
38void operator delete[] ( void* block )
39{
40  omfree( block );
41}
Note: See TracBrowser for help on using the repository browser.