GOffice.MemChunk

Fields

None

Methods

class

new (name, user_atom_size, chunk_size)

alloc ()

alloc0 ()

destroy (expect_leaks)

foreach_leak (cb, user)

free (mem)

Details

class GOffice.MemChunk
classmethod new(name, user_atom_size, chunk_size)
Parameters:
  • name (str) –

  • user_atom_size (int) –

  • chunk_size (int) –

Return type:

GOffice.MemChunk

alloc()
Returns:

an unused memory block

Return type:

object or None

alloc0()
Returns:

an unused memory block filled with 0

Return type:

object or None

destroy(expect_leaks)
Parameters:

expect_leaks (bool) –

foreach_leak(cb, user)
Parameters:

Loop over all non-freed memory in the chunk. It’s safe to allocate or free from the chunk in the callback.

free(mem)
Parameters:

mem (object or None) – item to release

Returns the given item to the pool.