Changeset 20d93fb737c36e2fa36fb1e9ac36734be14a77c6
- Timestamp:
- 06/20/10 04:33:21 (2 years ago)
- Author:
- redbrain <redbrain@…>
- Parents:
- 1eb94519d291051d1a07e4c29ecb03fc82fddc59
- Children:
- aaca19fb68c3cfe89e2acb105d2c3e8f5e028275
- git-committer:
- redbrain <redbrain@crules.org> / 2010-06-20T04:33:21Z+0100
- Message:
-
fixed return address garbage collection and a signed vs unsigned ref count issue
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r1eb9451
|
r20d93fb
|
|
| 29 | 29 | char *identifier; crl_opcode_t exp; |
| 30 | 30 | crl_opcode_t type, op_a_t, op_b_t; |
| 31 | | unsigned int n_ref; |
| | 31 | signed int n_ref; |
| 32 | 32 | union { |
| 33 | 33 | // literal primitive semantic types! |
-
|
r1eb9451
|
r20d93fb
|
|
| 179 | 179 | |
| 180 | 180 | // If no references remain |
| 181 | | if( o->n_ref == 0 ) |
| | 181 | if( o->n_ref <= 0 ) |
| 182 | 182 | { |
| 183 | 183 | crl_garbage_mark_obj( &o ); |
| … |
… |
|
| 436 | 436 | if( it ) |
| 437 | 437 | { |
| 438 | | if( it->n_ref == 0 ) |
| | 438 | if( it->n_ref <= 0 ) |
| 439 | 439 | { |
| 440 | 440 | crl_debug("marking object <%p>!\n", (void*)it ); |
| … |
… |
|
| 457 | 457 | (void*)it, it->n_ref ); |
| 458 | 458 | crl_dd_stack_push( head->symbol_stack, it ); |
| | 459 | s_arr[idx] = NULL; |
| 459 | 460 | } |
| 460 | 461 | else |
-
|
r1eb9451
|
r20d93fb
|
|
| 85 | 85 | if( deref ) |
| 86 | 86 | { |
| | 87 | crl_symbol_obj *xret = ctx->return_address; |
| 87 | 88 | void ** arr = ctx->symbol_stack->array; |
| 88 | 89 | unsigned int idx = 0; |
| … |
… |
|
| 93 | 94 | if( o ) |
| 94 | 95 | { |
| 95 | | o->n_ref--; |
| 96 | | crl_debug("de-referencing object <%p> to count <%i>!\n", |
| 97 | | (void*)o, o->n_ref ); |
| | 96 | if( o != xret ) |
| | 97 | { |
| | 98 | o->n_ref--; |
| | 99 | crl_debug("de-referencing object <%p> to count <%i>!\n", |
| | 100 | (void*)o, o->n_ref ); |
| | 101 | } |
| 98 | 102 | } |
| 99 | 103 | } |
-
|
r1eb9451
|
r20d93fb
|
|
| 1269 | 1269 | { |
| 1270 | 1270 | c->return_address= retval; |
| | 1271 | Crl_Ctx_Head_Branch( ctx )->return_address = retval; |
| 1271 | 1272 | f= true; break; |
| 1272 | 1273 | } |
| … |
… |
|
| 1380 | 1381 | break; |
| 1381 | 1382 | } |
| 1382 | | crl_garbage_invoke_sweep( context ); |
| 1383 | 1383 | |
| 1384 | 1384 | return rex; |