aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2006-04-10 18:40:27 +0000
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2006-04-10 18:40:27 +0000
commitfdf2b50316cc33a788e10140f04b990378f65486 (patch)
tree40ea5f8a2e65033942b343d4a3edb61c986c7381
parent81c40b39cbae084777c93fe5303c4ba9af8137c6 (diff)
downloadbusybox-w32-fdf2b50316cc33a788e10140f04b990378f65486.tar.gz
busybox-w32-fdf2b50316cc33a788e10140f04b990378f65486.tar.bz2
busybox-w32-fdf2b50316cc33a788e10140f04b990378f65486.zip
- make it resemble english and fix typo s/interperet/interpret/g;
-rw-r--r--docs/busybox.net/programming.html16
1 files changed, 8 insertions, 8 deletions
diff --git a/docs/busybox.net/programming.html b/docs/busybox.net/programming.html
index 1214e70f7..f54f018ed 100644
--- a/docs/busybox.net/programming.html
+++ b/docs/busybox.net/programming.html
@@ -259,15 +259,15 @@ before freeing them.</p>
259<p>With a very primitive MMU (using a base pointer plus length instead of page 259<p>With a very primitive MMU (using a base pointer plus length instead of page
260tables, which can provide virtual addresses and protect processes from each 260tables, which can provide virtual addresses and protect processes from each
261other, but no copy on write) you can still implement fork. But it's 261other, but no copy on write) you can still implement fork. But it's
262unreasonably expensive, because you have to copy all the parent process's 262unreasonably expensive, because you have to copy all the parent process'
263memory into the new process (which could easily be several megabytes per fork). 263memory into the new process (which could easily be several megabytes per fork).
264And you have to do this even though that memory gets freed again as soon as the 264And you have to do this even though that memory gets freed again as soon as the
265exec happens. (This is not just slow and a waste of space but causes memory 265exec happens. (This is not just slow and a waste of space but causes memory
266usage spikes that can easily cause the system to run out of memory.)</p> 266usage spikes that can easily cause the system to run out of memory.)</p>
267 267
268<p>Without even a primitive MMU, you have no virtual addresses. Every process 268<p>Without even a primitive MMU, you have no virtual addresses. Every process
269can reach out and touch any other process's memory, because all pointers are to 269can reach out and touch any other process' memory, because all pointers are to
270physical addresses with no protection. Even if you copy a process's memory to 270physical addresses with no protection. Even if you copy a process' memory to
271new physical addresses, all of its pointers point to the old objects in the 271new physical addresses, all of its pointers point to the old objects in the
272old process. (Searching through the new copy's memory for pointers and 272old process. (Searching through the new copy's memory for pointers and
273redirect them to the new locations is not an easy problem.)</p> 273redirect them to the new locations is not an easy problem.)</p>
@@ -307,7 +307,7 @@ failed to exec.)</p>
307(which presumably is much shorter than the heap), and leave the heap shared. 307(which presumably is much shorter than the heap), and leave the heap shared.
308Even with no MMU at all 308Even with no MMU at all
309In practice, you've just wound up in a multi-threaded situation and you can't 309In practice, you've just wound up in a multi-threaded situation and you can't
310do a malloc() or free() on your heap without freeing the other process's memory 310do a malloc() or free() on your heap without freeing the other process' memory
311(and if you don't have the proper locking for being threaded, corrupting the 311(and if you don't have the proper locking for being threaded, corrupting the
312heap if both of you try to do it at the same time and wind up stomping on 312heap if both of you try to do it at the same time and wind up stomping on
313each other while traversing the free memory lists). The thing about vfork is 313each other while traversing the free memory lists). The thing about vfork is
@@ -350,16 +350,16 @@ on their their sockets, now you know.)</p>
350<h2><a name="tips_memory">Memory used by relocatable code, PIC, and static linking.</a></h2> 350<h2><a name="tips_memory">Memory used by relocatable code, PIC, and static linking.</a></h2>
351 351
352<p>The downside of standard dynamic linking is that it results in self-modifying 352<p>The downside of standard dynamic linking is that it results in self-modifying
353code. Although each executable's pages are mmaped() into a process's address 353code. Although each executable's pages are mmaped() into a process' address
354space from the executable file and are thus naturally shared between processes 354space from the executable file and are thus naturally shared between processes
355out of the page cache, the library loader (ld-linux.so.2 or ld-uClibc.so.0) 355out of the page cache, the library loader (ld-linux.so.2 or ld-uClibc.so.0)
356writes to these pages to supply addresses for relocatable symbols. This 356writes to these pages to supply addresses for relocatable symbols. This
357dirties the pages, triggering copy-on-write allocation of new memory for each 357dirties the pages, triggering copy-on-write allocation of new memory for each
358processes's dirtied pages.</p> 358processes' dirtied pages.</p>
359 359
360<p>One solution to this is Position Independent Code (PIC), a way of linking 360<p>One solution to this is Position Independent Code (PIC), a way of linking
361a file so all the relocations are grouped together. This dirties fewer 361a file so all the relocations are grouped together. This dirties fewer
362pages (often just a single page) for each process's relocations. The down 362pages (often just a single page) for each process' relocations. The down
363side is this results in larger executables, which take up more space on disk 363side is this results in larger executables, which take up more space on disk
364(and a correspondingly larger space in memory). But when many copies of the 364(and a correspondingly larger space in memory). But when many copies of the
365same program are running, PIC dynamic linking trades a larger disk footprint 365same program are running, PIC dynamic linking trades a larger disk footprint
@@ -373,7 +373,7 @@ of a win anyway.</p>
373 373
374<p>You can tell the glibc linker to display debugging information about its 374<p>You can tell the glibc linker to display debugging information about its
375relocations with the environment variable "LD_DEBUG". Try 375relocations with the environment variable "LD_DEBUG". Try
376"LD_DEBUG=help /bin/true" for a list of commands. Learning to interperet 376"LD_DEBUG=help /bin/true" for a list of commands. Learning to interpret
377"LD_DEBUG=statistics cat /proc/self/statm" could be interesting.</p> 377"LD_DEBUG=statistics cat /proc/self/statm" could be interesting.</p>
378 378
379<h2><a name="who">Who are the BusyBox developers?</a></h2> 379<h2><a name="who">Who are the BusyBox developers?</a></h2>