aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGinger Bill <bill@gingerbill.org>2017-04-10 13:27:09 +0100
committerGinger Bill <bill@gingerbill.org>2017-04-10 13:27:09 +0100
commit3a3202fbc6fb6d7f0ae035e2b1ca3b513d276b73 (patch)
tree25dc79485a03266a1e90d187040867038a5bf525 /src
parentaaf355e750c0b1bf8ed17c9392250a52f0046f8c (diff)
Change code to match original MSVC
Diffstat (limited to 'src')
-rw-r--r--src/gb/gb.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/gb/gb.h b/src/gb/gb.h
index cad436640..39291d043 100644
--- a/src/gb/gb.h
+++ b/src/gb/gb.h
@@ -4873,7 +4873,7 @@ GB_ALLOCATOR_PROC(gb_heap_allocator_proc) {
case gbAllocation_Resize: {
ptr = realloc(old_memory, size);
// ptr = gb_default_resize_align(gb_heap_allocator(), old_memory, old_size, size, alignment);
- } break;
+ } break;
#else
// TODO(bill): *nix version that's decent
case gbAllocation_Alloc: {
@@ -5086,7 +5086,7 @@ void gb_affinity_init(gbAffinity *a) {
}
#undef AF__CHECK
}
-
+
fclose(cpu_info);
}
@@ -7619,10 +7619,11 @@ gbFileError gb_file_close(gbFile *f) {
return gbFileError_Invalid;
}
- //
+#if defined(GB_COMPILER_MSVC)
+ if (f->filename) gb_free(gb_heap_allocator(), cast(char *)f->filename);
+#else
// TODO HACK(bill): Memory Leak!!!
- // if (f->filename) gb_free(gb_heap_allocator(), cast(char *)f->filename);
- //
+#endif
#if defined(GB_SYSTEM_WINDOWS)
if (f->fd.p == INVALID_HANDLE_VALUE) {