From: Mark Wooding Date: Wed, 2 Aug 2017 09:52:06 +0000 (+0100) Subject: doc/concepts.tex: Warn about allocating resources in init methods. X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/sod/commitdiff_plain/d1b394fa5cde326c2635997ddb7cda27a52d537d doc/concepts.tex: Warn about allocating resources in init methods. --- diff --git a/doc/concepts.tex b/doc/concepts.tex index f7283e4..b48746e 100644 --- a/doc/concepts.tex +++ b/doc/concepts.tex @@ -741,7 +741,11 @@ environment in which it operates. Details of initialization are necessarily class-specific, but typically it involves setting the instance's slots to appropriate values, and possibly -linking it into some larger data structure to keep track of it. +linking it into some larger data structure to keep track of it. It is +possible for initialization methods to attempt to allocate resources, but +this must be done carefully: there is currently no way to report an error +from object initialization, so the object must be marked as incompletely +initialized, and left in a state where it will be safe to tear down later. Initialization is performed by sending the imprinted instance an @|init| message, defined by the @|SodObject| class. This message uses a nonstandard