summaryrefslogtreecommitdiff
path: root/src/pkg/runtime/malloc.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/pkg/runtime/malloc.h')
-rw-r--r--src/pkg/runtime/malloc.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/pkg/runtime/malloc.h b/src/pkg/runtime/malloc.h
index e07faf39f..133ed0232 100644
--- a/src/pkg/runtime/malloc.h
+++ b/src/pkg/runtime/malloc.h
@@ -168,6 +168,8 @@ struct MStats
uint64 nmalloc; // unprotected (approximate)
bool enablegc;
};
+
+#define mstats ·MemStats /* name shared with Go */
extern MStats mstats;
@@ -307,6 +309,9 @@ void* SysAlloc(uintptr);
void SysUnused(void*, uintptr);
void SysFree(void*, uintptr);
+void addfinalizer(void*, void*);
+void* getfinalizer(void*, bool);
+
enum
{
RefcountOverhead = 4, // one uint32 per object
@@ -315,5 +320,6 @@ enum
RefStack, // stack segment - don't free and don't scan for pointers
RefNone, // no references
RefSome, // some references
+ RefFinalize, // ready to be finalized
RefNoPointers = 0x80000000U, // flag - no pointers here
};