fieker-DuValspielwiese
Last change
on this file since 97c4ad was
65c733,
checked in by Hans Schönemann <hannes@…>, 18 years ago
|
*hannes: CC on ix86-SunOS
git-svn-id: file:///usr/local/Singular/svn/trunk@9360 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.5 2006-07-27 09:09:37 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 */ |
---|
16 | void* operator new ( size_t size ) |
---|
17 | { |
---|
18 | void* addr; |
---|
19 | if (!size) size = 1; |
---|
20 | omTypeAlloc(void*, addr, size); |
---|
21 | return addr; |
---|
22 | } |
---|
23 | |
---|
24 | void operator delete ( void* block ) |
---|
25 | { |
---|
26 | omfree( block ); |
---|
27 | } |
---|
28 | |
---|
29 | void* operator new[] ( size_t size ) |
---|
30 | { |
---|
31 | void* addr; |
---|
32 | if (! size) size = 1; |
---|
33 | omTypeAlloc(void*, addr, size); |
---|
34 | return addr; |
---|
35 | } |
---|
36 | |
---|
37 | void operator delete[] ( void* block ) |
---|
38 | { |
---|
39 | omfree( block ); |
---|
40 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.