Differences From Artifact [65f8ced397]:
- File src/natools-references__unsafe.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: 5598) [annotate] [blame] [check-ins using]
To Artifact [c4d7238aec]:
- File
src/natools-references__unsafe.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: 5727) [annotate] [blame] [check-ins using]
︙ | |||
66 67 68 69 70 71 72 73 74 75 76 77 78 79 | 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 | + + + | -- 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 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 |
︙ |