From owner-freebsd-questions Wed Nov 6 08:25:58 1996 Return-Path: owner-questions Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id IAA29433 for questions-outgoing; Wed, 6 Nov 1996 08:25:58 -0800 (PST) Received: from centaur.orion.ab.ca (orion.ab.ca [206.186.47.194]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id IAA29426 for ; Wed, 6 Nov 1996 08:25:54 -0800 (PST) Received: from localhost (timp@localhost) by centaur.orion.ab.ca (8.6.12/8.6.12) with SMTP id KAA03000 for ; Wed, 6 Nov 1996 10:24:44 GMT Date: Wed, 6 Nov 1996 10:24:44 +0000 () From: Tim Pushor To: questions@freebsd.org Subject: OS Memory questions Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-questions@freebsd.org X-Loop: FreeBSD.org Precedence: bulk I am fairly new to UNIX programming, and have found a home with FreeBSD :-) I have a couple of questions though about how FreeBSD deals with text memory. 1) If I have an app that uses a shared lib, and that shared lib is is use by another app, do the apps share the text area? 2) If I fork, is the text area shared? 3) I am using C++. In one case, I have a class that I use many times, e.g. MyClass class1,class2,class3,class4,class5; This class is basically just data, but does have a fairly elaborate constructor to massage the data, and allocate memory for other operations. My question is: Does the system share the text area of the class? It would seem a waste to have a copy of the code in memory multiple times. Thanks for any and all help. Tim --- Tim Pushor, Senior Systems Engineer | Phone: (403) 284-0042 Orion Technologies Inc. | FAX: (403) 284-9495 timp@orion.ab.ca | http://www.orion.ab.ca