x
Yes
No
Do you want to visit DriveHQ English website?
Inicio
Características
Precios
Prueba gratuita
Software cliente
Acerca de nosotros
Servidor de archivos
|
Solución de copias de seguridad
|
Servidor FTP
|
Servidor de correo electrónico
|
Alojamiento web
|
Software cliente
Servidor de archivos
Solución de copia de seguridad
Servidor FTP
Servidor de correo electrónico
Alojamiento web
Software cliente
daeMemorySystem.h - Hosted on DriveHQ Cloud IT Platform
Arriba
Subir
Descargar
Compartir
Publicar
Nueva carpeta
Nuevo archivo
Copiar
Cortar
Eliminar
Pegar
Clasificación
Actualizar
Ruta de la carpeta: \\game3dprogramming\materials\DarkPuzzle\libs\bullet_sdk\Extras\COLLADA_DOM\include\dae\daeMemorySystem.h
Girar
Efecto
Propiedad
Historial
/* * Copyright 2006 Sony Computer Entertainment Inc. * * Licensed under the SCEA Shared Source License, Version 1.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at: * http://research.scea.com/scea_shared_source_license.html * * Unless required by applicable law or agreed to in writing, software distributed under the License * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or * implied. See the License for the specific language governing permissions and limitations under the * License. */ #ifndef __DAE_MEMORY_SYSTEM_H__ #define __DAE_MEMORY_SYSTEM_H__ #include
/** * The @c daeMemorySystem class is a simple wrapper for memory operations. * Every allocation passes a string pool name such that * in the future different pools can be used based on allocation type. * Currently the system is just a pass-through to system @c malloc. */ class daeMemorySystem { public: /** * Provides a wrapper malloc with pool field. * @param pool String name of the pool to use for this allocation. * @param n Number of bytes to allocate. * @return Returns the memory allocated if successful, or NULL if not. */ static DLLSPEC daeRawRef malloc(daeString pool, size_t n); /** * Provides a wrapper free with pool argument. * @param pool Pool the memory should be freed from. * @param mem Memory to be freed. */ static DLLSPEC void free(daeString pool, daeRawRef mem); }; // Shorthand for defining new and delete overrides for classes, bad use of macros! #define DAE_ALLOC \ inline void* operator new(size_t n) { \ return daeMemorySystem::malloc("meta",n); \ } \ inline void* operator new(size_t , size_t runtimeSize) { \ return daeMemorySystem::malloc("meta",runtimeSize); \ } \ inline void operator delete(void* p) { \ daeMemorySystem::free("meta",p); \ } \ inline void operator delete(void* p, size_t runtimeSize) { \ (void)runtimeSize; \ daeMemorySystem::free("meta",p); \ } #endif // __DAE_MEMORY_H__
daeMemorySystem.h
Dirección de la página
Dirección del archivo
Anterior
17/33
Siguiente
Descargar
( 2 KB )
Comments
Total ratings:
0
Average rating:
No clasificado
of 10
Would you like to comment?
Join now
, or
Logon
if you are already a member.