Ignore:
Timestamp:
Oct 14, 1999, 3:19:22 AM (26 years ago)
Author:
bird
Message:

Changes during Pe2Lx rewrite.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/win32k/misc/new.cpp

    r847 r1271  
    1 /* $Id: new.cpp,v 1.1 1999-09-06 02:20:02 bird Exp $
     1/* $Id: new.cpp,v 1.2 1999-10-14 01:19:21 bird Exp $
    22 *
    33 * new - new and delete operators.
     
    2020
    2121#include "new.h"
    22 #include "cout.h"
    2322#include "malloc.h"
     23#include "log.h"
    2424
    2525
     26#pragma info(none)
    2627/**
    2728 * New.
     
    4041void *operator new(size_t size, void *location)
    4142{
    42     cout << "operator new(size,location) not implemented"<< endl;
     43    dprintf(("operator new(size,location) not implemented\n"));
    4344    return NULL;
    4445}
     
    5051void *operator new[](size_t size)
    5152{
    52     cout << "operator new[](size) not implemented"<< endl;
     53    dprintf(("operator new[](size) not implemented\n"));
    5354    return NULL;
    5455}
     
    6061void *operator new[](size_t size, void *location)
    6162{
    62     cout << "operator new[](size,location) not implemented"<< endl;
     63    dprintf(("operator new[](size,location) not implemented\n"));
    6364    return NULL;
    6465}
    6566
    66 
     67#ifndef __DEBUG_ALLOC__
    6768/**
    6869 * Delete.
     
    8081void operator delete[](void *location)
    8182{
    82     cout << "operator delete[](location) - not implemented" << endl;
     83    dprintf(("operator delete[](location) - not implemented\n"));
     84}
     85#endif
     86
     87/***
     88 *  debug!
     89 ***/
     90
     91/**
     92 * New.
     93 * @returns   pointer to allocated memory.
     94 * @param     Size  Size requested.
     95 */
     96void *operator new(size_t size, const char *filename, size_t lineno)
     97{
     98    return malloc(size);
    8399}
    84100
     101
     102/**
     103 * stub
     104 */
     105void *operator new(size_t size, const char *filename, size_t lineno, void *location)
     106{
     107    dprintf(("operator new(size,location) not implemented\n"));
     108    return NULL;
     109}
     110
     111
     112/**
     113 * stub
     114 */
     115void *operator new[](size_t size, const char *filename, size_t lineno)
     116{
     117    dprintf(("operator new[](size) not implemented\n"));
     118    return NULL;
     119}
     120
     121
     122/**
     123 * stub
     124 */
     125void *operator new[](size_t size, const char *filename, size_t lineno, void *location)
     126{
     127    dprintf(("operator new[](size,location) not implemented\n"));
     128    return NULL;
     129}
     130
     131#ifdef __DEBUG_ALLOC__
     132/**
     133 * Delete.
     134 * @param     location  Pointer to memory block which are to be freed.
     135 */
     136void operator delete(void *location, const char *filename, size_t lineno)
     137{
     138    free(location);
     139}
     140
     141
     142/**
     143 * stub
     144 */
     145void operator delete[](void *location, const char *filename, size_t lineno)
     146{
     147    dprintf(("operator delete[](location) - not implemented\n"));
     148}
     149#endif
Note: See TracChangeset for help on using the changeset viewer.