[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Liberty-eiffel] Happy new year

From: Cyril ADRIAN
Subject: Re: [Liberty-eiffel] Happy new year
Date: Fri, 23 Jan 2015 08:27:23 +0100


2015-01-22 22:53 GMT+01:00 Raphael Mack <address@hidden>:
documented is one point, but even more important would be in my eyes to detect it (e. g. by stricter checking, or some form of annotation in the "generation" feature of the std lib classes. And even better if we somehow could do this handling of generation automatically. I. e. introduce some notion, to define a feature which is to be called on every non-pure (may be qualified) call (here next_generation).

That would be some kind of AOP, out of scope of Eiffel unfortunately...

And what happens in case the collection already was modified (e. g. a new element added) and the BDW GC gets active before generation is increased?

I did not think of that. But the usual sequence is:
  1. calculate the new capacity in a local variable : usually new_capacity := capacity * 2
  2. alloc the new array in a local variable => only allocation, meaning that only here should the GC be activated
  3. copy the objects
  4. update capacity and array (in whatever order)
So in fact there should not be any actual problem.

And why capacity is used in a comparable way is still unclear for me...

But maybe we have to remove both the generation and capacity usage from the GC...

In fact `capacity' is used by BDW but not by SE's native GC. It may be a good idea to get rid of it in BDW.

Or, if it is really mandatory, there must be an error if the attribute is missing. See for instance C_NATIVE_FUNCTION_MAPPER.c_deep_twin_body (line 1280).

so if there is a feature capacity and multiple native arrays, all arrays shall have the same amount of used entries? (or capacity must be the maximum and the others explicitly clearing their unused elements...

Each native array will be able to hold as many items as the others : exactly `capacity' items. It does not say anything about how "full" the arrays are, for any definition of "full" (depending on the collection).



reply via email to

[Prev in Thread] Current Thread [Next in Thread]