Differences From Artifact [4a7ba030d7]:
- File src/natools-references.adb — part of check-in [c104c5befa] at 2014-07-11 20:37:15 on branch trunk — references: use access value directly in new constructors, instead of access to functions returning access value (user: nat, size: 4502) [annotate] [blame] [check-ins using]
- File src/natools-references__unsafe.adb — part of check-in [ed32c25b9b] at 2014-07-16 17:44:09 on branch trunk — references: prepare variants, calling "unsafe" the existing one (user: nat, size: 4502) [annotate] [blame] [check-ins using]
To Artifact [6254848d3e]:
- File
src/natools-references__unsafe.adb
— 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: 4627) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
107 108 109 110 111 112 113 114 115 116 117 118 119 120 | function Is_Empty (Ref : Immutable_Reference) return Boolean is begin return Ref.Count = null; end Is_Empty; function "=" (Left, Right : Immutable_Reference) return Boolean is begin return Left.Data = Right.Data; end "="; | > > > > > > | 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 | function Is_Empty (Ref : Immutable_Reference) return Boolean is begin return Ref.Count = null; end Is_Empty; function Is_Last (Ref : Immutable_Reference) return Boolean is begin return Ref.Count.all = 1; end Is_Last; function "=" (Left, Right : Immutable_Reference) return Boolean is begin return Left.Data = Right.Data; end "="; |
︙ | ︙ |