Last change
on this file since 847 was 847, checked in by bird, 26 years ago |
Initial checkin of Win32k. (not tested & pe2lx not up-to-date!)
|
File size:
1.6 KB
|
Line | |
---|
1 | /* $Id: new.cpp,v 1.1 1999-09-06 02:20:02 bird Exp $
|
---|
2 | *
|
---|
3 | * new - new and delete operators.
|
---|
4 | *
|
---|
5 | * Copyright (c) 1998-1999 knut st. osmundsen
|
---|
6 | *
|
---|
7 | */
|
---|
8 |
|
---|
9 | /*******************************************************************************
|
---|
10 | * Defined Constants *
|
---|
11 | *******************************************************************************/
|
---|
12 | #define INCL_DOS
|
---|
13 | #define INCL_DOSERRORS
|
---|
14 | #define INCL_NOAPI
|
---|
15 |
|
---|
16 | /*******************************************************************************
|
---|
17 | * Header Files *
|
---|
18 | *******************************************************************************/
|
---|
19 | #include <os2.h>
|
---|
20 |
|
---|
21 | #include "new.h"
|
---|
22 | #include "cout.h"
|
---|
23 | #include "malloc.h"
|
---|
24 |
|
---|
25 |
|
---|
26 | /**
|
---|
27 | * New.
|
---|
28 | * @returns pointer to allocated memory.
|
---|
29 | * @param Size Size requested.
|
---|
30 | */
|
---|
31 | void *operator new(size_t size)
|
---|
32 | {
|
---|
33 | return malloc(size);
|
---|
34 | }
|
---|
35 |
|
---|
36 |
|
---|
37 | /**
|
---|
38 | * stub
|
---|
39 | */
|
---|
40 | void *operator new(size_t size, void *location)
|
---|
41 | {
|
---|
42 | cout << "operator new(size,location) not implemented"<< endl;
|
---|
43 | return NULL;
|
---|
44 | }
|
---|
45 |
|
---|
46 |
|
---|
47 | /**
|
---|
48 | * stub
|
---|
49 | */
|
---|
50 | void *operator new[](size_t size)
|
---|
51 | {
|
---|
52 | cout << "operator new[](size) not implemented"<< endl;
|
---|
53 | return NULL;
|
---|
54 | }
|
---|
55 |
|
---|
56 |
|
---|
57 | /**
|
---|
58 | * stub
|
---|
59 | */
|
---|
60 | void *operator new[](size_t size, void *location)
|
---|
61 | {
|
---|
62 | cout << "operator new[](size,location) not implemented"<< endl;
|
---|
63 | return NULL;
|
---|
64 | }
|
---|
65 |
|
---|
66 |
|
---|
67 | /**
|
---|
68 | * Delete.
|
---|
69 | * @param location Pointer to memory block which are to be freed.
|
---|
70 | */
|
---|
71 | void operator delete(void *location)
|
---|
72 | {
|
---|
73 | free(location);
|
---|
74 | }
|
---|
75 |
|
---|
76 |
|
---|
77 | /**
|
---|
78 | * stub
|
---|
79 | */
|
---|
80 | void operator delete[](void *location)
|
---|
81 | {
|
---|
82 | cout << "operator delete[](location) - not implemented" << endl;
|
---|
83 | }
|
---|
84 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.