[m-dev.] cleanup of runtime/*

Fergus Henderson fjh at cs.mu.oz.au
Sat Feb 8 05:43:39 AEDT 1997


I wrote:
> 
> Hi Tom,
> 
> The following diff fixes a few bugs in your recent changes,
> some of which meant that it didn't compile on Solaris. [...]

Here's the detailed log message for those changes.

runtime/Mmake:
	Add missing entries for context.h, spinlock.h, and spinlock.c.

runtime/context.h:
	Delete an unnecessary #include.
	Use `typedef Word AtomicBool' rather than spreading that
	particular assumption throughout the code.

runtime/context.mod:
	Don't forget to #include "context.h".
	Use AtomicBool and SpinLock rather than Word.
	Use allocate_object() and allocate_array()
	rather than allocate_byte() and allocate_word().
	Fix a bug in some calls to get_lock() and release_lock()
	where it was passing the SpinLock itself rather than the
	SpinLock's address.  Add casts from `Word *' to `SpinLock *'
	to avoid depending on the assumption that SpinLock == Word.

runtime/imp.h:
	Delete the typedef for SpinLock, since it belongs in
	spinlock.h, not here.

runtime/memory.h:
	Define allocate_object() and allocate_array() macros.
	Delete the allocate_words() function, since allocate_array()
	should be used instead.
	Delete allocate_spinlock(), since that belongs in spinlock.h,
	not here.
	Use `size_t' rather than `unsigned' for counting memory sizes
	and offsets.

runtime/memory.c:
	Change the type of num_uses from `Word[]' to `unsigned long[]'.
	Use `size_t' rather than `unsigned' for counting memory sizes
	and offsets.  Use `int' rather than `Word' for the offset_count.
	Use SpinLock rather than Word for the offset_lock.
	Use allocate_object() and allocate_array()
	rather than allocate_byte() and allocate_word().
	Fix the indentation in a couple of places.
	Fix the syntax of a #error directive.

runtime/spinlock.c:
	Fix a syntax error.  This file had never been compiled.

runtime/spinlock.h:
	Add allocate_spinlock(), which was previous in memory.h.
	Add deallocate_spinlock().
	Separate out the interface and the implementation
	details and document the interface.
	Add missing #include statements that are needed
	to define things used in this file.
	Change the get_lock() and release_lock() macros so that
	they do not cast their argument; instead, the caller
	should cast it, if necessary.

runtime/wrapper.mod:
	Eliminate a cast which is no longer necessary.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>   |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>   |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3         |     -- the last words of T. S. Garp.



More information about the developers mailing list