Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Alchemy Viewer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Silent mode is enabled
All outbound communications are blocked.
Learn more
.
Show more breadcrumbs
Alchemy Viewer
Alchemy Viewer
Commits
c09532ac
Commit
c09532ac
authored
3 years ago
by
Euclid Linden
Browse files
Options
Downloads
Plain Diff
Merged in merge-541 (pull request #686)
Merge to latest 541
parents
a1a9c021
e6ae2400
No related branches found
No related tags found
1 merge request
!83
Merge Linden 6.6.7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
indra/llcommon/linden_common.h
+8
-0
8 additions, 0 deletions
indra/llcommon/linden_common.h
indra/llcommon/llcommon.cpp
+42
-0
42 additions, 0 deletions
indra/llcommon/llcommon.cpp
with
50 additions
and
0 deletions
indra/llcommon/linden_common.h
+
8
−
0
View file @
c09532ac
...
@@ -27,6 +27,14 @@
...
@@ -27,6 +27,14 @@
#ifndef LL_LINDEN_COMMON_H
#ifndef LL_LINDEN_COMMON_H
#define LL_LINDEN_COMMON_H
#define LL_LINDEN_COMMON_H
#include
"llprofiler.h"
#if (TRACY_ENABLE) // hooks for memory profiling
void
*
tracy_aligned_malloc
(
size_t
size
,
size_t
alignment
);
void
tracy_aligned_free
(
void
*
memblock
);
#define _aligned_malloc(X, Y) tracy_aligned_malloc((X), (Y))
#define _aligned_free(X) tracy_aligned_free((X))
#endif
// *NOTE: Please keep includes here to a minimum!
// *NOTE: Please keep includes here to a minimum!
//
//
// Files included here are included in every library .cpp file and
// Files included here are included in every library .cpp file and
...
...
This diff is collapsed.
Click to expand it.
indra/llcommon/llcommon.cpp
+
42
−
0
View file @
c09532ac
...
@@ -33,6 +33,48 @@
...
@@ -33,6 +33,48 @@
#include
"lltracethreadrecorder.h"
#include
"lltracethreadrecorder.h"
#include
"llcleanup.h"
#include
"llcleanup.h"
#if (TRACY_ENABLE)
// Override new/delet for tracy memory profiling
void
*
operator
new
(
size_t
size
)
{
auto
ptr
=
(
malloc
)
(
size
);
if
(
!
ptr
)
{
throw
std
::
bad_alloc
();
return
nullptr
;
}
TracyAlloc
(
ptr
,
size
);
return
ptr
;
}
void
operator
delete
(
void
*
ptr
)
noexcept
{
TracyFree
(
ptr
);
(
free
)(
ptr
);
}
// C-style malloc/free can't be so easily overridden, so we define tracy versions and use
// a pre-processor #define in linden_common.h to redirect to them. The parens around the native
// functions below prevents recursive substitution by the preprocessor.
//
// Unaligned mallocs are rare in LL code but hooking them causes problems in 3p lib code (looking at
// you, Havok), so we'll only capture the aligned version.
void
*
tracy_aligned_malloc
(
size_t
size
,
size_t
alignment
)
{
auto
ptr
=
(
_aligned_malloc
)
(
size
,
alignment
);
if
(
ptr
)
TracyAlloc
(
ptr
,
size
);
return
ptr
;
}
void
tracy_aligned_free
(
void
*
memblock
)
{
TracyFree
(
memblock
);
(
_aligned_free
)(
memblock
);
}
#endif
//static
//static
BOOL
LLCommon
::
sAprInitialized
=
FALSE
;
BOOL
LLCommon
::
sAprInitialized
=
FALSE
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment