Lines Matching refs:it
31 One of the most basic resources a process has available to it is memory.
42 page of all zeroes sometimes has nothing at all backing it -- there's
43 just a flag saying it is all zeroes.
74 described in @ref{Locking Pages} can control it.
82 generally much more of it than anyone needs. Memory allocation within a
87 programmatically. Actually, forking is a third way, but it's not very
91 loading its basic program into it, and executing the program. It is
93 operation takes a program file (an executable), it allocates space to
94 load all the data in the executable, loads it, and transfers control to
95 it. That data is most notably the instructions of the program (the
103 Once that program begins to execute, it uses programmatic allocation to
122 Just as it programmatically allocates memory, the program can
123 programmatically deallocate (@dfn{free}) it. You can't free the memory
146 it by calling functions as described in @xref{Resizing the Data
205 that varies. In other C implementations, it must be a constant.
219 continue to need it, depends on factors that are not known before the
224 allocate the memory dynamically and make it dynamically larger as you
229 allocate a new block for each record or definition as you read it.
243 allocated space is through a pointer. Because it is less convenient,
251 declare a variable of pointer type @code{struct foobar *} and assign it the
292 Therefore, it cannot happen that a large chunk becomes ``locked'' in between
326 block and clear it.
351 @c MT-unsafe, it's modifying the hooks and parameters while multiple
356 @c as the metadata of the memory areas assigned to it, are only modified
359 @c lock). Some reassurance was needed for fastbins, for it wasn't clear
406 @c NEXT_FREE list, but NEXT is never modified, so it's safe!
419 @c if we get to it, we're toast already, undefined behavior must have
588 The contents of the block are undefined; you must initialize it yourself
626 it is:
657 that it can hold any type of data. On @gnusystems{}, the address is
666 you asked for it to be, you are liable to destroy the data that
669 discover you want it to be bigger, use @code{realloc} (@pxref{Changing
727 the block after freeing it.} Copy whatever you need out of the block before
728 freeing it! Here is an example of the proper way to free all the blocks in
752 system and make the process smaller. Usually, all it can do is allow a
761 version of POSIX is planned to require it.
830 may find it necessary to copy the block to a new address where more free
840 it returns @code{NULL} and sets @code{errno}; the original block
865 happens, the original block is untouched; it has not been modified or
868 In most cases it makes no difference what happens to the original block
870 when it is out of memory, and the only thing to do is to give a fatal error
871 message. Often it is convenient to write and use subroutines,
898 @comment But it seems wise to keep the warning for other implementations.
900 necessitates copying it, so it can fail if no other space is available.
909 object, or it might fail and return @code{NULL} without freeing the block.
928 The function @code{calloc} allocates memory and clears it to zero. It
971 But in general, it is not guaranteed that @code{calloc} calls
974 memory block is zero, it need not zero out the block again with
1070 function in that it returns a buffer of @var{size} bytes aligned to a
1071 multiple of @var{alignment}. But it adds one requirement to the
1090 superseded by @code{aligned_alloc}, it is more portable to older POSIX
1172 heap, using the @code{mmap} system call. This way it is guaranteed
1192 guarantees that the content the block had before it was freed will be
1240 systems the limit is twice the number of cores online and on 64-bit systems, it
1288 case. The function returns @code{-1} if you call it too late, and
1289 @code{0} otherwise (when it is successful).
1319 @c threads, and it may find a partial update if called from a signal
1320 @c handler. It's mostly read only, so cancelling it might be safe, but
1321 @c it will modify global state that, if cancellation hits at just the
1327 @c result of mcheck's own internal data race. So, AC-Unsafe it is.
1379 it could possibly be exploited since diverging from the normal programs
1380 behavior it now writes something to the standard error descriptor.
1384 not important it could be empty).
1491 possibly by copying it to a new location. @xref{Changing Block Size}.
1576 events in the program that calls it. It is disabled by default in the
1581 When the @code{mtrace} function is called it looks for an environment
1584 file already exists it is truncated. If the environment variable is not
1585 set or it does not name a valid file which can be opened for writing
1612 Otherwise it deinstalls the handlers for @code{malloc}, @code{realloc},
1624 behavior of the program it is not a good idea to call @code{mtrace} in
1653 This last point is also why it is not a good idea to call @code{muntrace}
1669 all debugging sessions it runs well. But once it is started without
1714 If you take a look at the output it will look similar to this:
1732 user-friendly way. The program is called @code{mtrace} (it is in fact a
1733 Perl script) and it takes one or two arguments. In any case the name of
1743 In this case the program @code{tst-mtrace} was run and it produced a
1918 obstack}. This structure has a small fixed size; it records the status
1960 Also, if the source file uses the macro @code{obstack_init}, it must
1983 as an obstack, it must initialize the obstack by calling
2011 initialize it. First, an obstack that is a static variable:
2061 to allocate the block in; it is the address of the @code{struct obstack}
2066 it needs to allocate a new chunk of memory; it calls
2096 This allocates a block and initializes it by copying @var{size}
2150 uninitialized obstack. To free all memory in an obstack but leave it
2179 it may be computed more than once. For example, if you write this:
2193 function without calling it. An ordinary call uses the macro definition by
2224 Because memory in obstack chunks is used sequentially, it is possible to
2227 data you will put in the object until you come to the end of it. We call
2233 starts it. However, it is necessary to say explicitly when the object is
2237 object is finished. Until then, it always remains possible that you will
2240 While the obstack is in use for a growing object, you cannot use it for
2254 @code{obstack_blank}, which adds space without initializing it.
2319 @code{obstack_finish} to close it off and return its final address.
2328 When you build an object by growing it, you will probably need to know
2329 afterward how long it became. You need not keep track of this as you grow
2339 After it is finished, @code{obstack_object_size} will return zero.
2342 If you have started growing an object and wish to cancel it, you should
2343 finish it and then free it, like this:
2354 the current object smaller. Just don't try to shrink it beyond zero
2472 still growing it.
2479 immediately, it will have that address. If you make it larger first, it
2483 allocate will start (once again assuming it fits in the current
2565 longer needed because you have freed all the objects in it, the obstack
2580 or @code{obstack_chunk_free}, alone, expand into a function name if it is
2584 power of 2. The default chunk size, 4096, was chosen because it is long
2595 assigning it a new value. Doing so does not affect the chunks already
2598 smaller, but making it larger might improve efficiency if you are
2721 @c it safe with compilers generally.
2768 As you can see, it is simpler with @code{alloca}. But @code{alloca} has
2795 @code{open}, if it succeeds, but does not return to its caller if it
2796 fails. If the file cannot be opened, it prints an error message and
2812 Because of the way @code{alloca} works, the memory it allocates is
2816 @code{malloc} and @code{free}) would develop a memory leak if it were
2818 fix it, there is no easy way to do so.
2837 Some @nongnusystems{} fail to support @code{alloca}, so it is less
2903 The function fails if it would cause the data segment to overlap another
2910 toward it from the top of the segment and the curtain between them is
2925 @c segment, whether it succeeds or fails. The GNU C library Brk determines
2926 @c it's a failure if and only if the system call returns an address less
2982 without the @code{MAP_FIXED} flag will not use it for subsequent
3059 On some systems, it may not be possible to specify additional flags
3065 process memory, no matter how it was allocated. However, portable use
3066 of the function requires that it is only used with memory regions
3129 case it will behave in the same way as @code{mprotect}.
3133 it again:
3148 protection keys and it is not necessary to change the the access rights
3149 of the current thread (because it always has access).
3157 context switch, so it is more efficient.
3197 Deallocate the protection key, so that it can be reused by
3202 to it, even if it is subsequently allocated again. For this reason, it
3270 this means that the memory region will remain executable if it was
3312 with a real page frame and keep it that way --- i.e., cause the page to
3313 be paged in if it isn't already and mark it so it will never be paged
3324 * Page Lock Functions:: Here's how to do it.
3338 sensitive to how long it takes to do a simple memory access. Time-critical
3354 If a passphrase gets written out to disk swap space, for example, it might
3369 paging rule is: If a frame backs at least one locked page, don't page it
3373 so that it has to be unlocked twice before it is truly unlocked. It is
3374 either locked or it isn't.
3377 unlocks it. (But process termination and exec cause the virtual memory
3378 to cease to exist, which you might say means it isn't locked any more).
3389 and the amount of real memory it can have dedicated to it. @xref{Limits
3395 when it knows both virtual pages contain identical data, and does it
3398 But when a process modifies one of those pages, the kernel must get it a
3399 separate frame and fill it with the page's data. This is known as a
3409 maximum stack size you will need, set it to something, then return from
3436 long. Actually, since you must lock whole pages, it is the range of
3444 When the function fails, it does not affect the lock status of any
3447 The return value is zero if the function succeeds. Otherwise, it is
3527 space, and/or any that are added to it in the future. This includes the
3555 When the process is in @code{MCL_FUTURE} mode because it successfully
3564 When the function fails, it does not affect the lock status of any pages
3567 The return value is zero if the function succeeds. Otherwise, it is
3605 The return value is zero if the function succeeds. Otherwise, it is
3622 space it uses is more than the amount the program asks for. The
3651 address stored there whenever it moves the block, so that the handle
3676 If @code{r_alloc} can't get the space needed, it stores a null pointer
3685 in @code{*@var{handleptr}} to show it doesn't point to an allocated
3693 @code{*@var{handleptr}} points to, making it @var{size} bytes long. It
3716 check memory usage every time it asks for more memory from the operating
3733 Normally it ought to display the string for the user to read.
3736 The warnings come when memory becomes 75% full, when it becomes 85%
3737 full, and when it becomes 95% full. Above 95% you get another warning