[Gc] Re[2]: Patch for native support of long weakrefs

Ivan Maidanski ivmai at mail.ru
Thu Nov 15 01:22:48 PST 2012


Hi Zach,

1. You latest patch requires minor fixing (no need to repost this patch, just make another patch fixing this problem):
DCL_LOCK_STATE declares any local variables needed by LOCK and UNLOCK, so DCL_LOCK_STATE should be placed there LOCK/UNLOCK are (as I understand we could deprecate/remove DCL_LOCK_STATE but not now).

More refactoring:
2. GC_register_disappearing_link_inner: we can't move out locking from this function, so please move argument checking back to it (just to avoid code duplication)

3. GC_move_disappearing_link_inner: make lock/unlock out of this function (so that GC_move_disappearing_link will do lock/call GC_move_disappearing_link_inner/unlock/return res.

4. GC_unregister_disappearing_link_inner: I think it's better to move lock/unlock from it as well but, if so, it should return curr_dl (instead of 1) or NULL, while GC_unregister_disappearing_link should do arg checking, lock/unlock and GC_free/dl_set_next (for the latter operation, I suggest do define a macro like GC_FREE_DL_ENTRY - as I recall one if your submitted patches (with big defines) contained such macro).

As for refactoring GC_finalize, I'll reply you tomorrow.

Regards,
Ivan

15 11 2012 12:56:20 Zach Saw <zach.saw at gmail.com>:
>	
>
>
	
	
>
		
		
			
>Hi Ivan,
>
>
>>5. Move most code of GC_general_register_disappearing_link (except for arguments checks and locks) to new GC_register_disappearing_link_inner (it could be GC_INLINE) which should accept pointer to GC_dl_hashtbl (in addition to link and obj);
>>
same for GC_unregister_disappearing_link and GC_move_disappearing_link (code refactoring, step 2)
>>
>>
> 
>Step 2 refactoring is done:
>https://github.com/zachsaw/bdwgc/compare/d8e15a9...54e6788
>

>
>Please review.
>
>
>As for refactoring GC_finalize, I would suggest to first move code for "make disappearing links disappear" into GC_make_disappearing_links_disappear (GC_INLINE) with pointer to dl_hashtbl_s as the only argument. The same for GC_remove_dangling_disappearing_links.

>
>Zach
>			
		
		
	

	
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://napali.hpl.hp.com/pipermail/gc/attachments/20121115/2428fdc6/attachment.htm


More information about the Gc mailing list