--- a/ExternalAddress.st Wed Aug 04 18:03:48 2004 +0200
+++ b/ExternalAddress.st Thu Aug 05 13:48:43 2004 +0200
@@ -39,29 +39,30 @@
"
Instances of this class represent external (non-Smalltalk) addresses.
They are only useful to represent handles as returned by C functions
- as smalltalk objects. For example, Window- or WidgetIDs (which are actually
- 32 bit pointers) should be represented this way.
+ as smalltalk objects.
+ For example, Window- or WidgetIDs (which are actually 32 bit pointers) could be represented this way
+ (better create a handle-subclass for it, to care for proper finalization).
(you should not use SmallIntegers for this, since they can only represent 31
bits; LargeIntegers could be used in theory, but it is not a very good style
to do so, since it makes things a bit cryptic - having ExternalAddresses
around makes things pretty clear in inspectors etc.).
There is not much you can do with ExternalAddresses on the smalltalk level;
- creation/use is mostly in primitive C-code via
+ creation/use should be done in primitive C-code via
__MKEXTERNALADDRESS(voidPtr) and __ExternalAddressVal(obj).
ExternallAddresses are much like ExternalBytes - however, the latter
allow you to access bytes via indexed at:/at:put: messages.
- ExternalAddresses do not allow such accesses (they are meant to remain
- anonymous).
+ ExternalAddresses do not allow such accesses (they are meant to remain anonymous, opaque handles).
+ Also, memory blocks which are freeable should be represented as ExternalBytes.
[author:]
- Claus Gittinger
+ Claus Gittinger
[see also:]
- ByteArray
- ExternalBytes ExternalFunction
- ( how to write primitive code :html: programming/primitive.html )
+ ByteArray
+ ExternalBytes ExternalFunction
+ ( how to write primitive code :html: programming/primitive.html )
"
!
@@ -128,6 +129,12 @@
"
! !
+!ExternalAddress methodsFor:'Compatibility-Squeak'!
+
+beNull
+ self setAddress:0
+! !
+
!ExternalAddress methodsFor:'accessing'!
address
@@ -278,5 +285,5 @@
!ExternalAddress class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic/ExternalAddress.st,v 1.18 2003-05-07 14:10:07 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/ExternalAddress.st,v 1.19 2004-08-05 11:48:43 cg Exp $'
! !