13
* @defgroup MemoryM Memory Management
16
* @brief Memory management stuff.
18
* By default libssts does not use a GC, it can be enabled with by setting the
19
* USE_GC switch in cmake.
21
* Even if you have GC enabled, it is important to make sure that when you do
22
* not use the GC it will still cleanup all the pointers.
24
* General rule: for every @ref s_malloc() have a @ref s_free() even if you know
25
* you are running a GC.
29
* Represents what sort of memory management should be used. Used by
39
* The names of for the enum @ref SMMType.
42
schar * SMMTypeName[] = {
51
* Get the name of SMMType.
53
* For used in bindings.
56
s_mm_type_get_name (SMMType type);
59
* Set how memory should be dealth with.
61
* Only has effect if you compile with GC enabled.
64
s_mm_init (SMMType type);
67
* Clean up memory management.
74
* Get what sort of memory management is used.
80
* By default this is this is just a normal call to malloc. But with
81
* GC enabled it will use GC_MALLOC to allocate memory.
84
s_malloc (size_t size);
87
* by default this acts just as a normal call to free. If GC is enabled this
88
* will set the pointer to NULL.
91
s_free (spointer pointer);
94
* By default this will act just as a normal call to realloc. But if GC is
95
* enabled this will use GC_REALLOC.
98
s_realloc (spointer pointer, size_t size);
101
* By default this acts as a normal call to calloc. If GC in enabled this
102
* will just wrap GC_MALLOC, as there is no GC_CALLOC.
105
s_calloc (size_t num, size_t size);
115
#endif /* __H_MM__ */