From: Vladimir T. <vtz...@gm...> - 2008-10-21 16:58:32
|
Hi Sam, I am adding GC safe regions in pathname.d and came to the issue with check_file_reopen(truename,direction). We have to following line: var void *ret = with_file_id(namez,(void*)&flags,&find_open_file); Internally it calls stat() (GetFileInformationByHandle() and CreateFile() on Win32) so it definitely should be surrounded by GC safe region. However it also callbacks find_open_file() (declared in stream.d but used only from here) which accesses lisp heap - so no way to surround the whole "dynamic scope" of with_file_id() as GC safe. Also accessing O(open_files) requires a global lock - it's commented as TODO item in stream.d. I would "inline" the with_file_id() in check_file_open() - it is used only from here. However as I read the code - it looks like it is meant to be used from elsewhere as well? What would you recommend? Vladimir |