home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ User's Journal & Wi…eveloper's Journal Tools
/
C-C__Users_Journal_and_Windows_Developers_Journal_Tools_1997.iso
/
windbase
/
windbase.exe
/
MEMSLC.3
/
MYMAL.C
< prev
next >
Wrap
C/C++ Source or Header
|
1995-12-10
|
3KB
|
92 lines
/*****************************************************************************\
** **
** WW WW IIIIIIII NNN NN DDDDDDD BBBBBBB AA SSSSSS EEEEEEEE **
** WW W WW II NNNN NN DD DD BB BB AA AA SS EE **
** WW W WW II NN NN NN DD DD BBBBBBB AAAAAAAA SSSSSS EEEEEE **
** WW W WW II NN NNNN DD DD BB BB AA AA SS EE **
** WWWWW IIIIIIII NN NNN DDDDDDD BBBBBBB AA AA SSSSSS EEEEEEEE **
** **
** SSSSSS OOOOOO FFFFFFFF TTTTTTTT WW WW AA RRRRRRR EEEEEEEE **
** SS OO OO FF TT WW W WW AA AA RR RR EE **
** SSSSS OO OO FFFFF TT WW W WW AAAAAAAA RRRRRRR EEEEEE **
** SS OO OO FF TT WW W WW AA AA RR RR EE **
** SSSSSS OOOOOO FF TT WWWWW AA AA RR RR EEEEEEEE **
** **
*********** NOTICE ************************************************************
** This file contains valuable trade secrets and proprietary **
** assets of Windbase Software Inc. Embodying substantial **
** creative efforts and confidential information. Unauthorized **
** use, copying, decompiling, translating, disclosure or **
** transfer, of any kind, is strictly prohibited. **
** **
** COPYRIGHT (C) 1992, 1993, 1994. Windbase Software Inc. **
** ALL RIGHTS RESERVED. **
\*****************************************************************************/
#include <stdio.h>
#include <malloc.h>
/*
** User defined memory
**
** It is very important not to include the memsl.h header file
** or not to define WBMEMTRACE/WBUSERMEM (if the memsl header
** file is needed) as this would cause a recursive situation
** where the malloc() and free() calls below would be redifined
** by the macro definitions of malloc and free, which we want
** to be the real malloc() and free().
**
** If the memsl.h header file is included be sure to use the
** following defines:
** #if defined(WBMEMTRACE) || defined(WBUSERMEM)
** # undef WBMEMTRACE
** # undef WBUSERMEM
** #endif
*/
#undef WBMEMTRACE
#undef WBUSERMEM
#include "../memsl.h"
int i;
#ifdef WBSTDC
void *MyMalloc(void *notused, unsigned int size)
#else
void *MyMalloc(notused, size)
void *notused;
unsigned int size;
#endif
{
void *ritem;
WBTrcEntry(0,"MyMalloc",("%p, %d",notused,size));
notused = notused;
printf("MyMalloc(): %d\n",++i);
ritem = malloc(size);
WBTrcReturn(0,ritem,("%p",ritem));
}
#ifdef WBSTDC
void MyFree(void *notused, void *item)
#else
void MyFree(notused, item)
void *notused;
void *item;
#endif
{
WBTrcEntry(0,"MyFree",("%p, %p",notused,item));
notused = notused;
printf("MyFree(): %d\n",--i);
free(item);
WBTrcVReturn(WBTRC_MEMORY,(""));
}