mirror of
https://github.com/konsoletyper/teavm.git
synced 2024-11-27 01:30:35 +08:00
C: fix generation of heap dump
This commit is contained in:
parent
94a96f571b
commit
378111d767
@ -321,14 +321,12 @@ void teavm_gc_defragCompleted() {
|
||||
}
|
||||
|
||||
void teavm_gc_setDumpDirectory(const wchar_t* path) {
|
||||
#if TEAVM_MEMORY_TRACE
|
||||
if (teavm_gc_dumpDirectory != NULL) {
|
||||
free(teavm_gc_dumpDirectory);
|
||||
}
|
||||
size_t pathLen = wcslen(path);
|
||||
size_t bytesLen = sizeof(wchar_t) * (pathLen + 1);
|
||||
teavm_gc_dumpDirectory = malloc(bytesLen);
|
||||
memcpy(teavm_gc_dumpDirectory, path, bytesLen);
|
||||
#endif
|
||||
if (teavm_gc_dumpDirectory != NULL) {
|
||||
free(teavm_gc_dumpDirectory);
|
||||
}
|
||||
size_t pathLen = wcslen(path);
|
||||
size_t bytesLen = sizeof(wchar_t) * (pathLen + 1);
|
||||
teavm_gc_dumpDirectory = malloc(bytesLen);
|
||||
memcpy(teavm_gc_dumpDirectory, path, bytesLen);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user