aboutsummaryrefslogtreecommitdiff
path: root/py/gc.c
diff options
context:
space:
mode:
authorPaul Sokolovsky2014-02-12 18:31:30 +0200
committerPaul Sokolovsky2014-02-12 18:31:30 +0200
commit520e2f58a559c356ea540a5da4e9a585649aecc6 (patch)
tree864ecd62ad09ab6c1af200a52b7227f8cfdeb6b6 /py/gc.c
parentd5df6cd44a433d6253a61cb0f987835fbc06b2de (diff)
Replace global "static" -> "STATIC", to allow "analysis builds". Part 2.
Diffstat (limited to 'py/gc.c')
-rw-r--r--py/gc.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/py/gc.c b/py/gc.c
index 9c8d203d2..e66a6832d 100644
--- a/py/gc.c
+++ b/py/gc.c
@@ -21,14 +21,14 @@ typedef unsigned char byte;
#define BYTES_PER_BLOCK (WORDS_PER_BLOCK * BYTES_PER_WORD)
#define STACK_SIZE (64) // tunable; minimum is 1
-static byte *gc_alloc_table_start;
-static machine_uint_t gc_alloc_table_byte_len;
-static machine_uint_t *gc_pool_start;
-static machine_uint_t *gc_pool_end;
+STATIC byte *gc_alloc_table_start;
+STATIC machine_uint_t gc_alloc_table_byte_len;
+STATIC machine_uint_t *gc_pool_start;
+STATIC machine_uint_t *gc_pool_end;
-static int gc_stack_overflow;
-static machine_uint_t gc_stack[STACK_SIZE];
-static machine_uint_t *gc_sp;
+STATIC int gc_stack_overflow;
+STATIC machine_uint_t gc_stack[STACK_SIZE];
+STATIC machine_uint_t *gc_sp;
// ATB = allocation table byte
// 0b00 = FREE -- free block
@@ -116,7 +116,7 @@ void gc_init(void *start, void *end) {
} \
} while (0)
-static void gc_drain_stack(void) {
+STATIC void gc_drain_stack(void) {
while (gc_sp > gc_stack) {
// pop the next block off the stack
machine_uint_t block = *--gc_sp;
@@ -136,7 +136,7 @@ static void gc_drain_stack(void) {
}
}
-static void gc_deal_with_stack_overflow(void) {
+STATIC void gc_deal_with_stack_overflow(void) {
while (gc_stack_overflow) {
gc_stack_overflow = 0;
gc_sp = gc_stack;
@@ -152,7 +152,7 @@ static void gc_deal_with_stack_overflow(void) {
}
}
-static void gc_sweep(void) {
+STATIC void gc_sweep(void) {
// free unmarked heads and their tails
int free_tail = 0;
for (machine_uint_t block = 0; block < gc_alloc_table_byte_len * BLOCKS_PER_ATB; block++) {
@@ -351,7 +351,7 @@ void gc_dump_info() {
}
#if DEBUG_PRINT
-static void gc_dump_at(void) {
+STATIC void gc_dump_at(void) {
for (machine_uint_t bl = 0; bl < gc_alloc_table_byte_len * BLOCKS_PER_ATB; bl++) {
printf("block %06u ", bl);
switch (ATB_GET_KIND(bl)) {