… | |
… | |
969 | if (SCHEME_V->no_memory && USE_ERROR_CHECKING) |
969 | if (SCHEME_V->no_memory && USE_ERROR_CHECKING) |
970 | return S_SINK; |
970 | return S_SINK; |
971 | |
971 | |
972 | if (SCHEME_V->free_cell == NIL) |
972 | if (SCHEME_V->free_cell == NIL) |
973 | { |
973 | { |
974 | const int min_to_be_recovered = SCHEME_V->last_cell_seg < 128 ? 128 * 8 : SCHEME_V->last_cell_seg * 8; |
974 | const int min_to_be_recovered = SCHEME_V->cell_segsize [SCHEME_V->last_cell_seg] >> 2; |
975 | |
975 | |
976 | gc (SCHEME_A_ a, b); |
976 | gc (SCHEME_A_ a, b); |
977 | |
977 | |
978 | if (SCHEME_V->fcells < min_to_be_recovered || SCHEME_V->free_cell == NIL) |
978 | if (SCHEME_V->fcells < min_to_be_recovered || SCHEME_V->free_cell == NIL) |
979 | { |
979 | { |
… | |
… | |
1030 | } |
1030 | } |
1031 | |
1031 | |
1032 | static pointer |
1032 | static pointer |
1033 | get_vector_object (SCHEME_P_ uint32_t len, pointer init) |
1033 | get_vector_object (SCHEME_P_ uint32_t len, pointer init) |
1034 | { |
1034 | { |
1035 | pointer v = get_cell_x (SCHEME_A_ 0, 0); |
1035 | pointer v = get_cell_x (SCHEME_A_ NIL, NIL); |
1036 | pointer *e = malloc (len * sizeof (pointer)); |
1036 | pointer *e = malloc (len * sizeof (pointer)); |
1037 | |
1037 | |
1038 | if (!e && USE_ERROR_CHECKING) |
1038 | if (!e && USE_ERROR_CHECKING) |
1039 | return S_SINK; |
1039 | return S_SINK; |
1040 | |
1040 | |
… | |
… | |
1655 | |
1655 | |
1656 | /* garbage collect */ |
1656 | /* garbage collect */ |
1657 | clrmark (NIL); |
1657 | clrmark (NIL); |
1658 | SCHEME_V->fcells = 0; |
1658 | SCHEME_V->fcells = 0; |
1659 | SCHEME_V->free_cell = NIL; |
1659 | SCHEME_V->free_cell = NIL; |
|
|
1660 | |
|
|
1661 | if (SCHEME_V->gc_verbose) |
|
|
1662 | xwrstr ("freeing..."); |
1660 | |
1663 | |
1661 | uint32_t total = 0; |
1664 | uint32_t total = 0; |
1662 | |
1665 | |
1663 | /* Here we scan the cells to build the free-list. */ |
1666 | /* Here we scan the cells to build the free-list. */ |
1664 | for (i = SCHEME_V->last_cell_seg; i >= 0; i--) |
1667 | for (i = SCHEME_V->last_cell_seg; i >= 0; i--) |