source: trunk/src/win32k/misc/new.cpp@ 21916

Last change on this file since 21916 was 21916, checked in by dmik, 14 years ago

Merge branch gcc-kmk to trunk.

File size: 3.0 KB
Line 
1/* $Id: new.cpp,v 1.5 2000-09-02 21:08:14 bird Exp $
2 *
3 * new - new and delete operators.
4 *
5 * Copyright (c) 1998-1999 knut st. osmundsen
6 *
7 * Project Odin Software License can be found in LICENSE.TXT
8 *
9 */
10
11/*******************************************************************************
12* Defined Constants *
13*******************************************************************************/
14#define INCL_DOS
15#define INCL_DOSERRORS
16#define INCL_NOAPI
17
18/*******************************************************************************
19* Header Files *
20*******************************************************************************/
21#include <os2.h>
22
23#include "devSegDf.h" /* Win32k segment definitions. */
24#include "new.h"
25#include "rmalloc.h"
26#include "log.h"
27
28
29#pragma info(none)
30/**
31 * New.
32 * @returns pointer to allocated memory.
33 * @param Size Size requested.
34 */
35void *operator new(size_t size)
36{
37 return rmalloc(size);
38}
39
40
41/**
42 * stub
43 */
44void *operator new(size_t size, void *location) throw()
45{
46 dprintf(("operator new(size,location) not implemented\n"));
47 return NULL;
48}
49
50
51/**
52 * stub
53 */
54void *operator new[](size_t size) throw()
55{
56 dprintf(("operator new[](size) not implemented\n"));
57 return NULL;
58}
59
60
61/**
62 * stub
63 */
64void *operator new[](size_t size, void *location) throw()
65{
66 dprintf(("operator new[](size,location) not implemented\n"));
67 return NULL;
68}
69
70#ifndef __DEBUG_ALLOC__
71/**
72 * Delete.
73 * @param location Pointer to memory block which are to be freed.
74 */
75void operator delete(void *location)
76{
77 rfree(location);
78}
79
80
81/**
82 * stub
83 */
84void operator delete[](void *location) throw()
85{
86 dprintf(("operator delete[](location) - not implemented\n"));
87}
88#endif
89
90/***
91 * debug!
92 ***/
93
94/**
95 * New.
96 * @returns pointer to allocated memory.
97 * @param Size Size requested.
98 */
99void *operator new(size_t size, const char *filename, size_t lineno)
100{
101 return rmalloc(size);
102}
103
104
105/**
106 * stub
107 */
108void *operator new(size_t size, const char *filename, size_t lineno, void *location) throw()
109{
110 dprintf(("operator new(size,location) not implemented\n"));
111 return NULL;
112}
113
114
115/**
116 * stub
117 */
118void *operator new[](size_t size, const char *filename, size_t lineno) throw()
119{
120 dprintf(("operator new[](size) not implemented\n"));
121 return NULL;
122}
123
124
125/**
126 * stub
127 */
128void *operator new[](size_t size, const char *filename, size_t lineno, void *location) throw()
129{
130 dprintf(("operator new[](size,location) not implemented\n"));
131 return NULL;
132}
133
134#ifdef __DEBUG_ALLOC__
135/**
136 * Delete.
137 * @param location Pointer to memory block which are to be freed.
138 */
139void operator delete(void *location, const char *filename, size_t lineno)
140{
141 rfree(location);
142}
143
144
145/**
146 * stub
147 */
148void operator delete[](void *location, const char *filename, size_t lineno)
149{
150 dprintf(("operator delete[](location) - not implemented\n"));
151}
152#endif
Note: See TracBrowser for help on using the repository browser.