Am Montag, den 16.09.2013, 11:26 -0400 schrieb Yotam Barnoy: > Having looked through some of the ocaml runtime's code, I have a > question regarding the Double_array block tag. Why not use a single > tag for all block content that doesn't contain pointers instead? This > would allow optimization of all cases where no pointers are involved, > including float tuples, records with ints, bools and floats etc. > > The only use-case I've seen so far for Double_array tags is for > polymorphic comparison ie. we need the type information to parse > doubles correctly. However, the only default comparison that's valid > on an array of anything is an equality comparison, which is easily > doable without type information. Therefore, I'm confused as to why > this is necessary. You also need the Double_array tags for normal array accesses on 32 bit platforms: If you call a polymorphic function taking an array argument, the function doesn't know whether it is called with a float array or a normal array. Because of this, the compiler generates a dynamic check whether the array is float or something else. For float, every element is 64 bits wide, but for anything else it is 32 bits only. You are right that a special "no-scan" tag would speed up the GC marking phase when there are large arrays profiting from it - for all other no-scan cases except float. Gerd > > Thanks in advance for any answers > > Yotam Barnoy > -- ------------------------------------------------------------ Gerd Stolpmann, Darmstadt, Germany gerd@gerd-stolpmann.de My OCaml site: http://www.camlcity.org Contact details: http://www.camlcity.org/contact.html Company homepage: http://www.gerd-stolpmann.de ------------------------------------------------------------