Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
ygopro-core
Commits
cee2d843
Commit
cee2d843
authored
Jul 30, 2025
by
nanahira
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'patch-memtrack' of github.com:Fluorohydride/ygopro-core into develop
parents
31ef3c26
9198f9e4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
2 deletions
+3
-2
LuaMemTracker.cpp
LuaMemTracker.cpp
+2
-2
interpreter.h
interpreter.h
+1
-0
No files found.
LuaMemTracker.cpp
View file @
cee2d843
...
@@ -35,7 +35,7 @@ void* LuaMemTracker::AllocThunk(void* ud, void* ptr, size_t osize, size_t nsize)
...
@@ -35,7 +35,7 @@ void* LuaMemTracker::AllocThunk(void* ud, void* ptr, size_t osize, size_t nsize)
void
*
LuaMemTracker
::
Alloc
(
void
*
ptr
,
size_t
osize
,
size_t
nsize
)
{
void
*
LuaMemTracker
::
Alloc
(
void
*
ptr
,
size_t
osize
,
size_t
nsize
)
{
if
(
nsize
==
0
)
{
if
(
nsize
==
0
)
{
if
(
ptr
&&
osize
<=
total_allocated
)
{
if
(
ptr
)
{
total_allocated
-=
osize
;
total_allocated
-=
osize
;
}
}
return
real_alloc
(
real_ud
,
ptr
,
osize
,
nsize
);
return
real_alloc
(
real_ud
,
ptr
,
osize
,
nsize
);
...
@@ -75,6 +75,6 @@ void LuaMemTracker::write_log() {
...
@@ -75,6 +75,6 @@ void LuaMemTracker::write_log() {
std
::
fprintf
(
log_file
,
"%s | used = %zu bytes | max_used = %zu bytes | limit = unlimited
\n
"
,
std
::
fprintf
(
log_file
,
"%s | used = %zu bytes | max_used = %zu bytes | limit = unlimited
\n
"
,
time_buf
,
total_allocated
,
max_used
);
time_buf
,
total_allocated
,
max_used
);
std
::
fflush
(
log_file
);
//
确保实时写入磁盘
std
::
fflush
(
log_file
);
//
make it write instantly
}
}
#endif
#endif
interpreter.h
View file @
cee2d843
...
@@ -48,6 +48,7 @@ public:
...
@@ -48,6 +48,7 @@ public:
char
msgbuf
[
64
];
char
msgbuf
[
64
];
lua_State
*
lua_state
;
lua_State
*
lua_state
;
lua_State
*
current_state
;
lua_State
*
current_state
;
LuaMemTracker
*
mem_tracker
;
param_list
params
;
param_list
params
;
param_list
resumes
;
param_list
resumes
;
coroutine_map
coroutines
;
coroutine_map
coroutines
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment