source: git/kernel/mmalloc.cc @ 8c5988

spielwiese
Last change on this file since 8c5988 was 35aab3, checked in by Hans Schönemann <hannes@…>, 20 years ago
This commit was generated by cvs2svn to compensate for changes in r6879, which included commits to RCS files with non-trunk default branches. git-svn-id: file:///usr/local/Singular/svn/trunk@6880 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 784 bytes
Line 
1/****************************************
2*  Computer Algebra System SINGULAR     *
3****************************************/
4/* $Id: mmalloc.cc,v 1.1.1.1 2003-10-06 12:15:57 Singular 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  */
16void* operator new ( size_t size )
17{
18  void* addr;
19  if (!size) size = 1;
20  omTypeAlloc(void*, addr, size);
21  return addr;
22}
23
24void operator delete ( void* block )
25{
26  omfree( block );
27}
28
29void* operator new[] ( size_t size )
30{
31  void* addr;
32  if (! size) size = 1;
33  omTypeAlloc(void*, addr, size);
34  return addr;
35}
36
37void operator delete[] ( void* block )
38{
39  omfree( block );
40}
Note: See TracBrowser for help on using the repository browser.