RE: Procedure types

From: Campbell, Robert D (UK Edinburgh) <"Campbell,>
Date: Fri, 19 Nov 2004 09:28:21 +0000

----boundary-LibPST-iamunique-1844327810_-_-
Content-type: text/plain


In simple terms what do these two emails mean?

Are you both correct?

Is there a (unnecessary) safety problem with objects
and unloading that could have been avoided if the
compiler has been written differently?

(I think I have occasionally experienced the
problem Wojtek describes, but did not investigate
throughly. I have not considered the inability of
some program to survive 'malicious' unloading
of some of it's Modules as a bug. After all
unloading is not something a 'user' can do; it
requires a 'Developers' license.)


Robert.


>> Wojtek,
>>

>> After you unload the module TestUpper,
>> the object on the heap will continue to exits just fine.
>> It contains a hidden tag -- the pointer to the type

>> descriptor (so it will be garbage collected just fine, when

>> its time comes).
>> The type descriptor need not be unloaded along with

>> TestUpper. TestUpper knows its type descriptors, so it can

>> do things like NILlify back references from them to itself

>> when unloading, as well as NILlify pointers to methods.
>> So if an attempt to call the object's method (whose code is

>> in the unloaded TestUpper), the situation is easily

>> detected (e.g. the NILlified pointers to methods) and the

>> module can be reloaded.
>> All the information is available when it's needed, no

>> implementation difficulties.
>>

>> A procedure variable is just an address of the entry point

>> into the procedure: there is no auxiliary information to

>> help the run-time system.
>>

>> Cheers
>> Fyodor
>>

>> > > That is, a procedure variable may contain a dynamically

>> created reference
>> > > to a procedure in the module being unloaded, even if

>> the latter is not
>> > > related by import with the variable's module.
>> >
>> > Is the same not true with objects as well?
>> >
>> > MODULE TestLower;
>> > TYPE hookType* = POINTER TO EXTENSIBLE RECORD END;
>> > VAR hook* : hookType;
>> > END TestLower.
>> >
>> > MODULE TestUpper;
>> > IMPORT TestLower;
>> > TYPE myHook = POINTER TO RECORD (TestLower.hookType) END;
>> > VAR hook: myHook;
>> > BEGIN
>> > NEW (hook);
>> > TestLower.hook := hook;
>> > END TestUpper.
>> >
>> > As you see, I have installed a "hook object" in a module Lower.
>> > I can now unload module Upper because it does not have clients.
>> > What happens if TestUpper.hook uses resources from module Upper?
>> >
>> > Naturally, one should take care of this in the CLOSE

>> section of module
>> > TestUpper, but what if there is no CLOSE section? Can you

>> guarantee there

>> > are no safety problems if one unloads such a sloppy

>> module, even though I
>> > have not used procedure variables?
>> >
>> > What I am driving at is that possibly procedure variables

>> are no more
>> > dangerous than the O-O solution would have been, in the

>> hands of a sloppy
>> > programmer of course.
>> >
>> > Comments?
>> >
>> > W.

********************************************************************
This email and any attachments are confidential to the intended
recipient and may also be privileged. If you are not the intended
recipient please delete it from your system and notify the sender.
You should not copy it or use it for any purpose nor disclose or
distribute its contents to any other person.
********************************************************************
--------------------------------------------

To unsubscribe from this mailing list, send a message containing the word "unsubscribe" to:
   blackbox-request{([at]})nowhere.xy

To get a list of valid e-mail commands and instructions on their usage, send a message containing the word "help" to the above address.

Send any problem reports or questions related to this email list to the list owner at
   owner-blackbox{([at]})nowhere.xy

Current posting policy:

a) To post you should use the same address by which you are subscribed to the mailing list. That way, the list server will recognize you as subscriber and forward your posting immediately, without creating any overhead.

b) If, for some reason, you cannot post from the address, by which you are subscribed, your message will be moderated to avoid spam. Please understand that moderation will often cause some delay, in particular over weekends or holydays.


----boundary-LibPST-iamunique-1844327810_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"

e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzcyBBcmlhbDt9DQp7XGYxXGZtb2Rlcm4gQ291cmllciBOZXc7fQ0Ke1xmMlxmbmlsXGZjaGFy
c2V0MiBTeW1ib2w7fQ0Ke1xmM1xmbW9kZXJuXGZjaGFyc2V0MCBDb3VyaWVyIE5ldzt9fQ0Ke1xj
b2xvcnRibFxyZWQwXGdyZWVuMFxibHVlMDtccmVkMFxncmVlbjBcYmx1ZTI1NTt9DQpcdWMxXHBh
cmRccGxhaW5cZGVmdGFiMzYwIFxmMFxmczIwIFxwYXINCkluIHNpbXBsZSB0ZXJtcyB3aGF0IGRv
IHRoZXNlIHR3by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ZSB3aWxsIGJlIG1vZGVyYXRlZCB0byBhdm9pZCBzcGFtLiBQbGVhc2UgdW5kZXJzdGFu
ZCB0aGF0IG1vZGVyYXRpb24gd2lsbCBvZnRlbiBjYXVzZSBzb21lIGRlbGF5LCBpbiBwYXJ0aWN1
bGFyIG92ZXIgd2Vla2VuZHMgb3IgaG9seWRheXMuXHBhcg0KfQ=


----boundary-LibPST-iamunique-1844327810_-_---
Received on Fri Nov 19 2004 - 10:28:21 UTC

This archive was generated by hypermail 2.3.0 : Thu Sep 26 2013 - 06:28:31 UTC