Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
new.cpp
Package: helix.src.0812.rar [view]
Upload User: zhongxx05
Upload Date: 2007-06-06
Package Size: 33641k
Code Size: 2k
Category:
Symbian
Development Platform:
C/C++
- /*============================================================================*
- *
- * (c) 1995-2002 RealNetworks, Inc. Patents pending. All rights reserved.
- *
- *============================================================================*/
- // We can only overload new/malloc on the platform; dll stuff on emulator prevents this.
- #ifdef __MARM__
- #include <e32base.h>
- #include <estlib.h>
- #include <string.h>
- void* operator new(size_t size)
- {
- /* based on Symbian document, passing
- size > KMaxTInt/2 causes the Alloc function
- to throw USER 47 exception. In order to avoid
- the exception such that the player will gracefully
- shutdown with out of memory condition, the following
- check is added.*/
- if( size > (KMaxTInt/2) )
- User::Leave(KErrNoMemory);
- void *p = User::Alloc(size);
- if (p)
- memset(p, 0, size);
- else // allocation failure
- User::Leave(KErrNoMemory);
- return p;
- }
- void* operator new[](size_t size)
- {
- if( size > (KMaxTInt/2) )
- User::Leave(KErrNoMemory);
- void *p = User::Alloc(size);
- if (p)
- memset(p, 0, size);
- else // allocation failure
- User::Leave(KErrNoMemory);
- return p;
- }
- void operator delete(void* p)
- {
- if (p)
- User::Free(p);
- }
- void operator delete[](void* p)
- {
- if (p)
- User::Free(p);
- }
- extern "C"
- {
- void* malloc(size_t size);
- void* realloc(void* pOld, size_t size);
- void free(void* p);
- }
- void* malloc(size_t size)
- {
- if( size > (KMaxTInt/2) )
- User::Leave(KErrNoMemory);
- void *p = User::Alloc(size);
- if (p == 0) // allocation failure
- User::Leave(KErrNoMemory);
- return p;
- }
- void* realloc(void* pOld, size_t size)
- {
- void* p = User::ReAlloc(pOld, size);
- if (p == 0) // allocation failure
- User::Leave(KErrNoMemory);
- return p;
- }
- void free(void* p)
- {
- if (p)
- User::Free(p);
- }
- #endif // __MARM__