MLib Memory Allocation

MLib Memory Allocation — General memory-handling

Stability Level

Unstable, unless otherwise indicated

Synopsis

#include <mlib.h>

muint               m_memory_get_freed                  (void);
muint               m_memory_get_allocated              (void);
muint               m_memory_get_dif_freed              (void);
muint               m_memory_get_dif_allocated          (void);
void                m_memory_print_mem                  (void);

Description

These functions provide support for allocating and freeing memory.

Le funzioni m_memory_get_freed(), m_memory_get_allocated(), m_memory_get_dif_freed(), m_memory_get_dif_allocated(), m_memory_print_mem() non saranno definite nei sistemi Windows.

Note

If any call to allocate memory fails, the application is terminated. This also means that there is no need to check if the call succeeded.

Note

It's important to match m_malloc with m_free , plain malloc() with free() , and (if you're using C++) new with delete and new[] with delete[]. Otherwise bad things can happen, since these allocators may use different memory pools (and new/delete call constructors and destructors).

Details

m_memory_get_freed ()

muint               m_memory_get_freed                  (void);

stability: Unstable

Returns :

la quantità di memoria dinamica liberata attraverso le funzioni free (...)

Since 0.0.1


m_memory_get_allocated ()

muint               m_memory_get_allocated              (void);

stability: Unstable

Returns :

la quantità di memoria dinamica allocata attraverso le funzioni malloc (...)

Since 0.0.1


m_memory_get_dif_freed ()

muint               m_memory_get_dif_freed              (void);

stability: Unstable

Returns :

la quantità di memoria dinamica liberata attraverso le ultime chiamate ad una funzione free (...)

Since 0.0.1


m_memory_get_dif_allocated ()

muint               m_memory_get_dif_allocated          (void);

stability: Unstable

Returns :

la quantità di memoria dinamica allocata attraverso le ultime chiamate ad una funzione malloc (...)

Since 0.0.1


m_memory_print_mem ()

void                m_memory_print_mem                  (void);

stability: Unstable

Stampa su standard output i valori rispettivamente ritornati dalle funzioni :

m_memory_get_freed()

m_memory_get_allocated()

m_memory_get_dif_freed()

m_memory_get_dif_allocated()

Since 0.0.1

See Also

GLib Memory Allocation