VR-Forces 4.7 Class Documentation
Home
Modules
Namespaces
Classes
Files
Examples
Behavior Models
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
include
vrvUtil
vrvUtil.h
Go to the documentation of this file.
1
/*******************************************************************************
2
** Copyright (c) 2018 MAK Technologies, Inc.
3
** All rights reserved.
4
*******************************************************************************/
5
9
10
#pragma once
11
#ifdef _WIN32
12
# pragma warning( error : 4700 )
13
# pragma warning( error : 4701 )
14
# pragma warning( error : 4101 )
15
# pragma warning( error : 4189 )
16
# pragma warning( error : 4715 )
17
# pragma warning( error : 4239 )
18
# pragma warning( error : 4150 )
19
# pragma warning( error : 4553 )
20
# pragma warning( disable : 4512 )
21
# pragma warning( disable : 4511 )
22
# pragma warning( disable : 4396 )
23
# pragma warning( disable : 4832 )
24
# pragma warning( disable : 4996 )
25
# ifdef _M_X64 //64bit application, set DT_MEMORY_64
26
# define DT_MEMORY_64
27
# endif
28
# ifdef vrvUtil_EXPORTS
29
# define DT_DLL_VRVUTIL __declspec ( dllexport )
30
# else
31
# define DT_DLL_VRVUTIL __declspec ( dllimport )
32
# ifdef _DEBUG
33
# pragma comment(lib,"vrvUtild.lib")
34
# else
35
# pragma comment(lib,"vrvUtil.lib")
36
# endif
37
# endif
38
#else
39
# define DT_DLL_VRVUTIL
40
# if defined(__LP64__) || defined(_LP64) //64bit application, set DT_MEMORY_64
41
# define DT_MEMORY_64
42
# endif
43
#endif
44
#include <memory>
45
46
// Defining this to 1 gets the memory track capability compiled into your application
47
// (which also needs to call mem_start() and mem_stop() - see stealth\stealth.cxx for example).
48
// #define MEMTRACK 1
49
50
//
51
52
#if MEMTRACK
53
54
namespace
makVrv
55
{
56
DT_DLL_VRVUTIL
void
mem_enable(
bool
enabled);
57
DT_DLL_VRVUTIL
bool
mem_enabled();
58
DT_DLL_VRVUTIL
void
mem_initializeSymbols();
59
DT_DLL_VRVUTIL
void
mem_track(
void
* p,
size_t
size
);
60
DT_DLL_VRVUTIL
void
mem_release(
void
* p);
61
DT_DLL_VRVUTIL
void
mem_start( );
62
DT_DLL_VRVUTIL
void
mem_stop( );
63
DT_DLL_VRVUTIL
void
mem_frame(
double
time );
64
DT_DLL_VRVUTIL
void
mem_long( );
65
DT_DLL_VRVUTIL
void
mem_clear( );
66
DT_DLL_VRVUTIL
void
mem_print(
bool
pointers );
67
}
68
69
inline
void
*
operator
new
(
size_t
size
)
70
{
71
void
*p=malloc(
size
);
72
makVrv::mem_track(p,
size
);
73
if
(p==0)
// did malloc succeed?
74
{
75
throw
std::bad_alloc();
// ANSI/ISO compliant behavior
76
}
77
return
p;
78
}
79
80
inline
void
*
operator
new
[] (
size_t
size
)
81
{
82
void
*p=malloc(
size
);
83
makVrv::mem_track(p,
size
);
84
if
(p==0)
// did malloc succeed?
85
{
86
throw
std::bad_alloc();
// ANSI/ISO compliant behavior
87
}
88
return
p;
89
}
90
91
inline
void
operator
delete
(
void
*p)
92
{
93
if
(p)
94
{
95
makVrv::mem_release(p);
96
free(p);
97
}
98
}
99
100
inline
void
operator
delete
[] (
void
* p)
101
{
102
if
(p)
103
{
104
makVrv::mem_release(p);
105
free(p);
106
}
107
}
108
109
#endif
110
111
namespace
makVrv
112
{
113
typedef
double
DtDynamicTerrainTimeType
;
114
}
Document ID: Generated on Fri Apr 26 21:53:14 EDT 2019 from SVN revision 197883
Copyright © 2005-2019 VT MAK. All Rights Reserved (
www.mak.com
)