parrotcode: Allocate and deallocate tracked resources | |
Contents | C |
src/gc/resources.c - Allocate and deallocate tracked resources
alloc_new_block
mem_allocate
+-----------------+
| ref_count |f | # GC header
obj->bufstart -> +-----------------+
| data |
v v
* if PObj_is_COWable is set, then we have
- a ref_count, {inc,dec}remented by 2 always
- the lo bit 'f' means 'is being forwarded" - what TAIL_flag was
* if PObj_align_FLAG is set, obj->bufstart is aligned like discussed above
* obj->buflen is the usable length excluding the optional GC part.
buffer_location
debug_print_buf
compact_pool
Parrot_go_collect
aligned_size
aligned_mem
aligned_string_size
Parrot_in_memory_pool
Parrot_reallocate
Parrot_reallocate_string
str->strstart
to the new buffer location, str->bufused
is not changed.Parrot_allocate
size
has to be a multiple of the word size. PObj_buflen
will be set to exactly the given size
.Parrot_allocate_aligned
size
will be rounded up and the address of the buffer will have the same alignment as a pointer returned by malloc(3) suitable to hold e.g. a FLOATVAL
array.Parrot_allocate_string
size
. This function sets also str->strstart
to the new buffer location, str->bufused
is not changed.new_memory_pool
Parrot_initialize_memory_pools
Parrot_destroy_memory_pools
merge_pools
Parrot_merge_memory_pools
source_interp
into dest_interp
.include/parrot/resources.h, src/gc/memory.c.
Initial version by Dan on 2001.10.2.
|