From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel,gmane.emacs.gnus.general Subject: Re: require inside functions. (was: Changes in calendar/time-date.el) Date: Thu, 07 Apr 2005 23:22:22 -0400 Message-ID: References: <871x9w9dkn.fsf@xs4all.nl> <87mzsezu5f.fsf@xs4all.nl> <87hdimzou0.fsf@xs4all.nl> <87ll7uwy6m.fsf_-_@xs4all.nl> Reply-To: rms@gnu.org NNTP-Posting-Host: main.gmane.org X-Trace: sea.gmane.org 1112930598 7233 80.91.229.2 (8 Apr 2005 03:23:18 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 8 Apr 2005 03:23:18 +0000 (UTC) Cc: reiner.steib@gmx.de, ding@gnus.org, emacs-devel@gnu.org, storm@cua.dk, snogglethorpe@gmail.com, miles@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Apr 08 05:23:14 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DJk4g-0001lL-8q for ged-emacs-devel@m.gmane.org; Fri, 08 Apr 2005 05:22:26 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DJje6-0003g0-Mz for ged-emacs-devel@m.gmane.org; Thu, 07 Apr 2005 22:54:58 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DJjcd-0002pr-UJ for emacs-devel@gnu.org; Thu, 07 Apr 2005 22:53:28 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DJjcZ-0002m8-Um for emacs-devel@gnu.org; Thu, 07 Apr 2005 22:53:24 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DJjcZ-0002lA-Fe for emacs-devel@gnu.org; Thu, 07 Apr 2005 22:53:23 -0400 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DJk5m-0000rP-3x for emacs-devel@gnu.org; Thu, 07 Apr 2005 23:23:34 -0400 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.34) id 1DJk4c-0007Kv-Uq; Thu, 07 Apr 2005 23:22:22 -0400 Original-To: Lute Kamstra In-reply-to: <87ll7uwy6m.fsf_-_@xs4all.nl> (message from Lute Kamstra on Thu, 07 Apr 2005 14:47:45 +0200) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:35736 gmane.emacs.gnus.general:60120 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:35736 (require 'ft) only loads a file if 'ft is not in features. However, it unconditionally adds '(require . ft) to current-load-list. If you call a function with require a million times, this eats up 16 MB of memory. This was done deliberately. The idea is that it's useful to record that file foo depends on file bar, even if bar was already loaded before foo. However, it isn't useful to record (require . bar) an additional time in current-load-list when it's already there. So I think the right fix is to check with Fmember and not add it a second time.