discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

GScheme improved. (browse-environment primitive)


From: Marko Riedel
Subject: GScheme improved. (browse-environment primitive)
Date: 31 Jul 2002 20:29:08 +0200
User-agent: Gnus/5.0807 (Gnus v5.8.7) XEmacs/21.1 (Cuyahoga Valley)

The following message is a courtesy copy of an article
that has been posted to comp.lang.scheme as well.


Hi all,

GScheme needs a lot of improvements. I started with the memory
management, which was very poor. I used to wrap my scheme objects in
NSValue objects in order to protect them from GNUstep's retain/release
mechanism. This slowed things down quite a bit. The new version does
not use NSValue for this purpose and cooperates with GNUstep
instead. This makes the evaluator simpler and faster, although it is
not nearly fast enough.

GNUstep empties autorelease pools in the main application loop. I
wasn't aware of this and hence GScheme had some very bad memory
leaks. The GC would collect free items during the computation, but the
memory wasn't being released until the return to the event loop. This
is now fixed. There is a local autorelease pool that is emptied after
the GC is run. The result is that GScheme can solve the 6 queens
problem in constant space. I also cleaned up some memory leaks in the
GUI.

I fixed the code that prints scheme data to properly take circularity
due to vectors and pairs into account, and it works quite nicely.

There is a new feature! The primitive "browse-environment" (example in
"browse.scm") pops up a window with the current environment chain. The
user can navigate up and down the chain. This should help with
environment diagrams.

Best regards,

-- 
+------------------------------------------------------------+
| Marko Riedel, EDV Neue Arbeit gGmbH, address@hidden |
| http://www.geocities.com/markoriedelde/index.html          |
+------------------------------------------------------------+



reply via email to

[Prev in Thread] Current Thread [Next in Thread]