malloctest.html 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <html>
  2. <head>
  3. <title>malloctest</title>
  4. <body bgcolor=#ffffff>
  5. <h2 align=center>malloctest</h2>
  6. <h4 align=center>OS/161 Reference Manual</h4>
  7. <h3>Name</h3>
  8. malloctest - some simple tests for userlevel malloc
  9. <h3>Synopsis</h3>
  10. /testbin/malloctest [<em>test</em>...]
  11. <h3>Description</h3>
  12. malloctest contains 7 tests, 1-7. These may be run interactively or
  13. from the command line.
  14. <p>
  15. Test 1 checks if all the bytes we ask for actually get allocated.
  16. <p>
  17. Test 2 checks if malloc gracefully handles failing requests. This test
  18. assumes that malloc will eventually fail if one keeps allocating
  19. enough memory, instead of promising memory it can't deliver and
  20. then (perhaps) killing processes when it runs out. More detail
  21. regarding this condition can be found in comments in the source code.
  22. <p>
  23. Test 3 also checks if malloc gracefully handles failing requests, and
  24. thus has the same restrictions as test 2.
  25. <p>
  26. Test 4 attempts to check if malloc coalesces the free list properly.
  27. This test is only meant for first-fit, next-fit, or best-fit
  28. allocators; anything else will most likely confuse it. Running test 4
  29. after other tests may confuse it as well.
  30. <p>
  31. Tests 5-7 are a randomized stress test. Test 5 uses pseudorandom seed
  32. 0. Test 6 seeds the random generator from the
  33. <A HREF=../dev/random.html>random:</A> device. Test 7 prompts you for
  34. a specific seed.
  35. <p>
  36. <h3>Requirements</h3>
  37. malloctest uses the following system calls:
  38. <ul>
  39. <li> <A HREF=../syscall/open.html>open</A>
  40. <li> <A HREF=../syscall/read.html>read</A>
  41. <li> <A HREF=../syscall/write.html>write</A>
  42. <li> <A HREF=../syscall/close.html>close</A>
  43. <li> <A HREF=../syscall/_exit.html>_exit</A>
  44. </ul>
  45. malloctest also requires a user-level malloc/free implementation.
  46. <p>
  47. Your system should pass all the malloctest tests, subject to the
  48. conditions described above, once your user-level malloc is complete.
  49. </body>
  50. </html>