make-obstacks-texi.pl: New.
contrib/ 2013-03-06 Tobias Burnus <burnus@net-b.de> * make-obstacks-texi.pl: New. libiberty/ 2013-03-06 Tobias Burnus <burnus@net-b.de> * libiberty.texi: Update comment, remove lowersections. * obstacks.texi: Regenerate. From-SVN: r196486
This commit is contained in:
parent
3c27ce4cd4
commit
34d3a672a8
@ -1,3 +1,7 @@
|
|||||||
|
2013-03-06 Tobias Burnus <burnus@net-b.de>
|
||||||
|
|
||||||
|
* make-obstacks-texi.pl: New.
|
||||||
|
|
||||||
2013-02-27 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
|
2013-02-27 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
|
||||||
|
|
||||||
* make_sunver.pl: Enforce C locale.
|
* make_sunver.pl: Enforce C locale.
|
||||||
|
46
contrib/make-obstacks-texi.pl
Normal file
46
contrib/make-obstacks-texi.pl
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
#!/usr/bin/perl -w
|
||||||
|
|
||||||
|
# (C) 2013 Free Software Foundation
|
||||||
|
# Contributed by Tobias Burnus
|
||||||
|
#
|
||||||
|
# This script is Free Software, and it can be copied, distributed and
|
||||||
|
# modified as defined in the GNU General Public License. A copy of
|
||||||
|
# its license can be downloaded from http://www.gnu.org/copyleft/gpl.html
|
||||||
|
|
||||||
|
use strict;
|
||||||
|
use File::Basename;
|
||||||
|
|
||||||
|
|
||||||
|
if ($#ARGV != 0 or $ARGV[0] eq "") {
|
||||||
|
my $name = basename($0);
|
||||||
|
|
||||||
|
print "\nUSAGE: `$name` memory.texi\n\n";
|
||||||
|
print "Reads GLIBC's manual/memory.texi and extracts the obstacks section\n"
|
||||||
|
."Redirect the output to update GCC's libiberty/obstacks.texi\n\n";
|
||||||
|
exit 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
open (IN, "<$ARGV[0]") || die "Cannot open '$ARGV[0]': $!";
|
||||||
|
my $data = join ("", <IN>);
|
||||||
|
close (IN);
|
||||||
|
|
||||||
|
$data =~ s/.*\@node Obstacks\n/\@node Obstacks\n/s;
|
||||||
|
$data =~ s/\n\@node [^\n]+\n\@subsection.*/\n/s;
|
||||||
|
|
||||||
|
# Add refs to GLIBC
|
||||||
|
$data =~ s/(\@p?xref{[^}]*)}/$1, , , libc, The GNU C Library Reference Manual}/gs;
|
||||||
|
|
||||||
|
|
||||||
|
# And undo the refs which are in this file
|
||||||
|
my @nodes = grep /^\@node /, (split /\n/, $data);
|
||||||
|
|
||||||
|
foreach my $node (@nodes) {
|
||||||
|
$node =~ s/\@node //;
|
||||||
|
$node =~ s/,.*//;
|
||||||
|
$node =~ s/ / *\n?/g;
|
||||||
|
chomp ($node);
|
||||||
|
|
||||||
|
$data =~ s/(\@p?xref{$node), , , libc, The GNU C Library Reference Manual}/$1}/gsi;
|
||||||
|
}
|
||||||
|
|
||||||
|
print $data;
|
@ -1,3 +1,8 @@
|
|||||||
|
2013-03-06 Tobias Burnus <burnus@net-b.de>
|
||||||
|
|
||||||
|
* libiberty.texi: Update comment, remove lowersections.
|
||||||
|
* obstacks.texi: Regenerate.
|
||||||
|
|
||||||
2013-03-05 Jakub Jelinek <jakub@redhat.com>
|
2013-03-05 Jakub Jelinek <jakub@redhat.com>
|
||||||
|
|
||||||
PR middle-end/56526
|
PR middle-end/56526
|
||||||
|
@ -241,13 +241,8 @@ central location from which to use, maintain, and distribute them.
|
|||||||
* Obstacks:: Stacks of arbitrary objects.
|
* Obstacks:: Stacks of arbitrary objects.
|
||||||
@end menu
|
@end menu
|
||||||
|
|
||||||
@c This is generated from the glibc manual using a make-obstacks-texi.sh
|
@c This is generated from the glibc manual using contrib/make-obstacks-texi.pl
|
||||||
@c script of Phil's. Hope it's accurate.
|
|
||||||
@lowersections
|
|
||||||
@lowersections
|
|
||||||
@include obstacks.texi
|
@include obstacks.texi
|
||||||
@raisesections
|
|
||||||
@raisesections
|
|
||||||
|
|
||||||
@node Functions
|
@node Functions
|
||||||
@chapter Function, Variable, and Macro Listing.
|
@chapter Function, Variable, and Macro Listing.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
@node Obstacks
|
@node Obstacks
|
||||||
@chapter Obstacks
|
@subsection Obstacks
|
||||||
@cindex obstacks
|
@cindex obstacks
|
||||||
|
|
||||||
An @dfn{obstack} is a pool of memory containing a stack of objects. You
|
An @dfn{obstack} is a pool of memory containing a stack of objects. You
|
||||||
@ -33,7 +33,7 @@ the padding needed to start each object on a suitable boundary.
|
|||||||
@end menu
|
@end menu
|
||||||
|
|
||||||
@node Creating Obstacks
|
@node Creating Obstacks
|
||||||
@section Creating Obstacks
|
@subsubsection Creating Obstacks
|
||||||
|
|
||||||
The utilities for manipulating obstacks are declared in the header
|
The utilities for manipulating obstacks are declared in the header
|
||||||
file @file{obstack.h}.
|
file @file{obstack.h}.
|
||||||
@ -74,7 +74,7 @@ directly or indirectly. You must also supply a function to free a chunk.
|
|||||||
These matters are described in the following section.
|
These matters are described in the following section.
|
||||||
|
|
||||||
@node Preparing for Obstacks
|
@node Preparing for Obstacks
|
||||||
@section Preparing for Using Obstacks
|
@subsubsection Preparing for Using Obstacks
|
||||||
|
|
||||||
Each source file in which you plan to use the obstack functions
|
Each source file in which you plan to use the obstack functions
|
||||||
must include the header file @file{obstack.h}, like this:
|
must include the header file @file{obstack.h}, like this:
|
||||||
@ -160,7 +160,7 @@ obstack_alloc_failed_handler = &my_obstack_alloc_failed;
|
|||||||
@end defvar
|
@end defvar
|
||||||
|
|
||||||
@node Allocation in an Obstack
|
@node Allocation in an Obstack
|
||||||
@section Allocation in an Obstack
|
@subsubsection Allocation in an Obstack
|
||||||
@cindex allocation (obstacks)
|
@cindex allocation (obstacks)
|
||||||
|
|
||||||
The most direct way to allocate an object in an obstack is with
|
The most direct way to allocate an object in an obstack is with
|
||||||
@ -233,7 +233,7 @@ Contrast this with the previous example of @code{savestring} using
|
|||||||
@code{malloc} (@pxref{Basic Allocation, , , libc, The GNU C Library Reference Manual}).
|
@code{malloc} (@pxref{Basic Allocation, , , libc, The GNU C Library Reference Manual}).
|
||||||
|
|
||||||
@node Freeing Obstack Objects
|
@node Freeing Obstack Objects
|
||||||
@section Freeing Objects in an Obstack
|
@subsubsection Freeing Objects in an Obstack
|
||||||
@cindex freeing (obstacks)
|
@cindex freeing (obstacks)
|
||||||
|
|
||||||
To free an object allocated in an obstack, use the function
|
To free an object allocated in an obstack, use the function
|
||||||
@ -265,7 +265,7 @@ frees the chunk (@pxref{Preparing for Obstacks}). Then other
|
|||||||
obstacks, or non-obstack allocation, can reuse the space of the chunk.
|
obstacks, or non-obstack allocation, can reuse the space of the chunk.
|
||||||
|
|
||||||
@node Obstack Functions
|
@node Obstack Functions
|
||||||
@section Obstack Functions and Macros
|
@subsubsection Obstack Functions and Macros
|
||||||
@cindex macros
|
@cindex macros
|
||||||
|
|
||||||
The interfaces for using obstacks may be defined either as functions or
|
The interfaces for using obstacks may be defined either as functions or
|
||||||
@ -321,7 +321,7 @@ various language extensions in GNU C permit defining the macros so as to
|
|||||||
compute each argument only once.
|
compute each argument only once.
|
||||||
|
|
||||||
@node Growing Objects
|
@node Growing Objects
|
||||||
@section Growing Objects
|
@subsubsection Growing Objects
|
||||||
@cindex growing objects (in obstacks)
|
@cindex growing objects (in obstacks)
|
||||||
@cindex changing the size of a block (obstacks)
|
@cindex changing the size of a block (obstacks)
|
||||||
|
|
||||||
@ -435,7 +435,7 @@ the current object smaller. Just don't try to shrink it beyond zero
|
|||||||
length---there's no telling what will happen if you do that.
|
length---there's no telling what will happen if you do that.
|
||||||
|
|
||||||
@node Extra Fast Growing
|
@node Extra Fast Growing
|
||||||
@section Extra Fast Growing Objects
|
@subsubsection Extra Fast Growing Objects
|
||||||
@cindex efficiency and obstacks
|
@cindex efficiency and obstacks
|
||||||
|
|
||||||
The usual functions for growing objects incur overhead for checking
|
The usual functions for growing objects incur overhead for checking
|
||||||
@ -538,7 +538,7 @@ add_string (struct obstack *obstack, const char *ptr, int len)
|
|||||||
@end smallexample
|
@end smallexample
|
||||||
|
|
||||||
@node Status of an Obstack
|
@node Status of an Obstack
|
||||||
@section Status of an Obstack
|
@subsubsection Status of an Obstack
|
||||||
@cindex obstack status
|
@cindex obstack status
|
||||||
@cindex status of obstack
|
@cindex status of obstack
|
||||||
|
|
||||||
@ -580,12 +580,13 @@ obstack_next_free (@var{obstack-ptr}) - obstack_base (@var{obstack-ptr})
|
|||||||
@end deftypefun
|
@end deftypefun
|
||||||
|
|
||||||
@node Obstacks Data Alignment
|
@node Obstacks Data Alignment
|
||||||
@section Alignment of Data in Obstacks
|
@subsubsection Alignment of Data in Obstacks
|
||||||
@cindex alignment (in obstacks)
|
@cindex alignment (in obstacks)
|
||||||
|
|
||||||
Each obstack has an @dfn{alignment boundary}; each object allocated in
|
Each obstack has an @dfn{alignment boundary}; each object allocated in
|
||||||
the obstack automatically starts on an address that is a multiple of the
|
the obstack automatically starts on an address that is a multiple of the
|
||||||
specified boundary. By default, this boundary is 4 bytes.
|
specified boundary. By default, this boundary is aligned so that
|
||||||
|
the object can hold any type of data.
|
||||||
|
|
||||||
To access an obstack's alignment boundary, use the macro
|
To access an obstack's alignment boundary, use the macro
|
||||||
@code{obstack_alignment_mask}, whose function prototype looks like
|
@code{obstack_alignment_mask}, whose function prototype looks like
|
||||||
@ -597,7 +598,9 @@ this:
|
|||||||
The value is a bit mask; a bit that is 1 indicates that the corresponding
|
The value is a bit mask; a bit that is 1 indicates that the corresponding
|
||||||
bit in the address of an object should be 0. The mask value should be one
|
bit in the address of an object should be 0. The mask value should be one
|
||||||
less than a power of 2; the effect is that all object addresses are
|
less than a power of 2; the effect is that all object addresses are
|
||||||
multiples of that power of 2. The default value of the mask is 3, so that
|
multiples of that power of 2. The default value of the mask is a value
|
||||||
|
that allows aligned objects to hold any type of data: for example, if
|
||||||
|
its value is 3, any type of data can be stored at locations whose
|
||||||
addresses are multiples of 4. A mask value of 0 means an object can start
|
addresses are multiples of 4. A mask value of 0 means an object can start
|
||||||
on any multiple of 1 (that is, no alignment is required).
|
on any multiple of 1 (that is, no alignment is required).
|
||||||
|
|
||||||
@ -620,7 +623,7 @@ This will finish a zero-length object and then do proper alignment for
|
|||||||
the next object.
|
the next object.
|
||||||
|
|
||||||
@node Obstack Chunks
|
@node Obstack Chunks
|
||||||
@section Obstack Chunks
|
@subsubsection Obstack Chunks
|
||||||
@cindex efficiency of chunks
|
@cindex efficiency of chunks
|
||||||
@cindex chunks
|
@cindex chunks
|
||||||
|
|
||||||
@ -676,7 +679,7 @@ if (obstack_chunk_size (obstack_ptr) < @var{new-chunk-size})
|
|||||||
@end smallexample
|
@end smallexample
|
||||||
|
|
||||||
@node Summary of Obstacks
|
@node Summary of Obstacks
|
||||||
@section Summary of Obstack Functions
|
@subsubsection Summary of Obstack Functions
|
||||||
|
|
||||||
Here is a summary of all the functions associated with obstacks. Each
|
Here is a summary of all the functions associated with obstacks. Each
|
||||||
takes the address of an obstack (@code{struct obstack *}) as its first
|
takes the address of an obstack (@code{struct obstack *}) as its first
|
||||||
|
Loading…
Reference in New Issue
Block a user