From: nobu.nokada@... Date: 2004-10-27T09:47:54+09:00 Subject: Re: Errors in line numbers reported? Hi, At Wed, 27 Oct 2004 01:58:51 +0900, Markus wrote in [ruby-talk:117790]: > This seems to be along the lines I was thinking, but there seems > to be more to it than I was imagining, and I do not understand all of > it. Why is the interaction with the GC needed? Wouldn't it be enough > to allocate them and keep them around forever? Do you mean: typedef struct { #ifdef NODE_SEGMENTED_LINENO unsigned char lineno_upper; #endif char gcmark, name[1]; } srcfilename; and ptr = ALLOC_N(char, len + offsetof(srcfile, name)); ... srcfilename *ptr = (srcfilename *)(f - offsetof(srcfile, name)); ? Just because I didn't prefer reverting a member to the struct containing it, there is no definite reason. > I was thinking it could be done by patching node.h (to add and > adjust macros), eval.c (to use them), and parse.y, to make a small > struct with int line_number_offset and char *file_name to store in the > RNODEs in place of nd_file. The main complexity would be making a new > current struct any time a RNODE was created and > > ruby_sourceline - current->line_number_offset >= 8*1024 > > Is there a reason that I am not seeing why this would not work? To save memory space. -- Nobu Nakada