From af944c3e4ba74f59f21178c8477fdea4b682ef2b Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sun, 25 Jan 2009 01:57:18 +0000 Subject: remove texinfo git-svn-id: svn://tug.org/texlive/trunk@11963 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/utils/texinfo/info/gc.c | 91 ------------------------------------ 1 file changed, 91 deletions(-) delete mode 100644 Build/source/utils/texinfo/info/gc.c (limited to 'Build/source/utils/texinfo/info/gc.c') diff --git a/Build/source/utils/texinfo/info/gc.c b/Build/source/utils/texinfo/info/gc.c deleted file mode 100644 index 9fa19891bf4..00000000000 --- a/Build/source/utils/texinfo/info/gc.c +++ /dev/null @@ -1,91 +0,0 @@ -/* gc.c -- Functions to remember and garbage collect unused node contents. - $Id: gc.c,v 1.6 2007/07/01 22:32:12 karl Exp $ - - Copyright (C) 1993, 2004, 2007 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or (at - your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - - Written by Brian Fox (bfox@ai.mit.edu). */ - -#include "info.h" - -/* Array of pointers to the contents of gc-able nodes. A pointer on this - list can be garbage collected when no info window contains a node whose - contents member match the pointer. */ -static char **gcable_pointers = (char **)NULL; -static int gcable_pointers_index = 0; -static int gcable_pointers_slots = 0; - -/* Add POINTER to the list of garbage collectible pointers. A pointer - is not actually garbage collected until no info window contains a node - whose contents member is equal to the pointer. */ -void -add_gcable_pointer (char *pointer) -{ - gc_pointers (); - add_pointer_to_array (pointer, gcable_pointers_index, gcable_pointers, - gcable_pointers_slots, 10, char *); -} - -/* Grovel the list of info windows and gc-able pointers finding those - node->contents which are collectible, and free them. */ -void -gc_pointers (void) -{ - register int i, j, k; - INFO_WINDOW *iw; - char **new = (char **)NULL; - int new_index = 0; - int new_slots = 0; - - if (!info_windows || !gcable_pointers_index) - return; - - for (i = 0; (iw = info_windows[i]); i++) - { - for (j = 0; j < iw->nodes_index; j++) - { - NODE *node = iw->nodes[j]; - - /* If this node->contents appears in our list of gcable_pointers, - it is not gc-able, so save it. */ - for (k = 0; k < gcable_pointers_index; k++) - if (gcable_pointers[k] == node->contents) - { - add_pointer_to_array - (node->contents, new_index, new, new_slots, 10, char *); - break; - } - } - } - - /* We have gathered all of the pointers which need to be saved. Free any - of the original pointers which do not appear in the new list. */ - for (i = 0; i < gcable_pointers_index; i++) - { - for (j = 0; j < new_index; j++) - if (gcable_pointers[i] == new[j]) - break; - - /* If we got all the way through the new list, then the old pointer - can be garbage collected. */ - if (new && !new[j]) - free (gcable_pointers[i]); - } - - free (gcable_pointers); - gcable_pointers = new; - gcable_pointers_slots = new_slots; - gcable_pointers_index = new_index; -} -- cgit v1.2.3