Differences From Artifact [0b0ecf7c36]:
- File src/natools-references__intel.ads — part of check-in [3b9912ed66] at 2014-07-19 18:27:21 on branch trunk — Add pragma Preelaborable_Initialization throughout the code (user: nat, size: 5906) [annotate] [blame] [check-ins using]
To Artifact [8d5344f138]:
- File
src/natools-references__intel.ads
— part of check-in
[610b834d9d]
at
2014-08-24 20:31:35
on branch trunk
— references: add Is_Last primitive
It's almost a break in abstraction, and it's unsafe to use when the reference can be accessed concurrently. However it might have some use in some context, to free the last reference when checked in a protected or thread-local context, to build a crude garbage collection system. (user: nat, size: 6135) [annotate] [blame] [check-ins using]
︙ | |||
69 70 71 72 73 74 75 76 77 78 79 80 81 82 | 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 | + + + + + | -- package and must NOT be freed or changed or accessed. procedure Reset (Ref : in out Immutable_Reference); -- Empty Ref function Is_Empty (Ref : Immutable_Reference) return Boolean; -- Check whether Ref refers to an actual object function Is_Last (Ref : Immutable_Reference) return Boolean; -- Check whether Ref is the last reference to its object. -- WARNING: This is inherently not task-safe if Ref can be -- concurrently accessed. function "=" (Left, Right : Immutable_Reference) return Boolean; -- Check whether Left and Right refer to the same object function Query (Ref : in Immutable_Reference) return Accessor; pragma Inline (Query); -- Return a derefenciable constant access to the held object |
︙ |