Guest User

Untitled

a guest
Apr 26th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.36 KB | None | 0 0
  1. -> allocate list
  2. malloc( 24) => 0x100100080 [slist.c:7 in slist_alloc()]
  3. list @0x100100080, head 0x0, tail 0x0, size 0
  4.  
  5. -> push (add to top)
  6. malloc( 16) => 0x1001000a0 [slist.c:48 in slist_node_alloc()]
  7. list @0x100100080, head 0x1001000a0, tail 0x1001000a0, size 1
  8. node @0x1001000a0, data 0xdecafbad2, next 0x0, pos 0
  9.  
  10. -> append (add to back)
  11. malloc( 16) => 0x1001000b0 [slist.c:48 in slist_node_alloc()]
  12. list @0x100100080, head 0x1001000a0, tail 0x1001000b0, size 2
  13. node @0x1001000a0, data 0xdecafbad2, next 0x1001000b0, pos 0
  14. node @0x1001000b0, data 0xbaadf00d4, next 0x0, pos 1
  15.  
  16. -> insert (at position 0)
  17. malloc( 16) => 0x1001000c0 [slist.c:48 in slist_node_alloc()]
  18. list @0x100100080, head 0x1001000c0, tail 0x1001000b0, size 3
  19. node @0x1001000c0, data 0xcafebabe1, next 0x1001000a0, pos 0
  20. node @0x1001000a0, data 0xdecafbad2, next 0x1001000b0, pos 1
  21. node @0x1001000b0, data 0xbaadf00d4, next 0x0, pos 2
  22.  
  23. -> insert (at position 2)
  24. malloc( 16) => 0x1001000d0 [slist.c:48 in slist_node_alloc()]
  25. list @0x100100080, head 0x1001000c0, tail 0x1001000b0, size 4
  26. node @0x1001000c0, data 0xcafebabe1, next 0x1001000a0, pos 0
  27. node @0x1001000a0, data 0xdecafbad2, next 0x1001000d0, pos 1
  28. node @0x1001000d0, data 0xdeadbeef3, next 0x1001000b0, pos 2
  29. node @0x1001000b0, data 0xbaadf00d4, next 0x0, pos 3
  30.  
  31. -> check size (should be 4)
  32. -> test if first node it correct
  33. -> test if last node is correct
  34. -> copy list
  35. malloc( 24) => 0x1001000e0 [slist.c:7 in slist_alloc()]
  36. malloc( 16) => 0x100100100 [slist.c:61 in slist_node_copy()]
  37. malloc( 16) => 0x100100110 [slist.c:61 in slist_node_copy()]
  38. malloc( 16) => 0x100100120 [slist.c:61 in slist_node_copy()]
  39. malloc( 16) => 0x100100130 [slist.c:61 in slist_node_copy()]
  40. list @0x1001000e0, head 0x100100100, tail 0x100100130, size 4
  41. node @0x100100100, data 0xcafebabe1, next 0x100100110, pos 0
  42. node @0x100100110, data 0xdecafbad2, next 0x100100120, pos 1
  43. node @0x100100120, data 0xdeadbeef3, next 0x100100130, pos 2
  44. node @0x100100130, data 0xbaadf00d4, next 0x0, pos 3
  45.  
  46. -> free lists
  47. free(0x1001000c0) [slist.c:36 in slist_free()]
  48. free(0x1001000a0) [slist.c:36 in slist_free()]
  49. free(0x1001000d0) [slist.c:36 in slist_free()]
  50. free(0x1001000b0) [slist.c:36 in slist_free()]
  51. free(0x100100080) [slist.c:42 in slist_free()]
  52. free(0x100100100) [slist.c:36 in slist_free()]
  53. free(0x100100110) [slist.c:36 in slist_free()]
  54. free(0x100100120) [slist.c:36 in slist_free()]
  55. free(0x100100130) [slist.c:36 in slist_free()]
  56. free(0x1001000e0) [slist.c:42 in slist_free()]
  57. -> copy empty list
  58. malloc( 24) => 0x1001000e0 [slist.c:7 in slist_alloc()]
  59. malloc( 24) => 0x100100100 [slist.c:7 in slist_alloc()]
  60. list @0x100100100, head 0x0, tail 0x0, size 0
  61.  
  62. -> insert some data
  63. malloc( 16) => 0x100100120 [slist.c:48 in slist_node_alloc()]
  64. list @0x100100100, head 0x100100120, tail 0x100100120, size 1
  65. node @0x100100120, data 0xc0debabe5, next 0x0, pos 0
  66.  
  67. -> remove nonexistant node
  68. list @0x100100100, head 0x100100120, tail 0x100100120, size 1
  69. node @0x100100120, data 0xc0debabe5, next 0x0, pos 0
  70.  
  71. -> inserting another node
  72. malloc( 16) => 0x100100130 [slist.c:48 in slist_node_alloc()]
  73. list @0x100100100, head 0x100100130, tail 0x100100120, size 2
  74. node @0x100100130, data 0xcafebabe1, next 0x100100120, pos 0
  75. node @0x100100120, data 0xc0debabe5, next 0x0, pos 1
  76.  
  77. -> remove existing node
  78. free(0x100100130) [slist.c:268 in slist_pop()]
  79. list @0x100100100, head 0x100100120, tail 0x100100120, size 1
  80. node @0x100100120, data 0xc0debabe5, next 0x0, pos 0
  81.  
  82. -> popping nonexistant node
  83. -> popping existant node
  84. free(0x100100120) [slist.c:268 in slist_pop()]
  85. list @0x100100100, head 0x0, tail 0x0, size 0
  86.  
  87. -> filling list with data
  88. malloc( 16) => 0x100100120 [slist.c:48 in slist_node_alloc()]
  89. malloc( 16) => 0x100100130 [slist.c:48 in slist_node_alloc()]
  90. malloc( 16) => 0x100100080 [slist.c:48 in slist_node_alloc()]
  91. malloc( 16) => 0x100100090 [slist.c:48 in slist_node_alloc()]
  92. malloc( 16) => 0x1001000a0 [slist.c:48 in slist_node_alloc()]
  93. malloc( 16) => 0x1001000b0 [slist.c:48 in slist_node_alloc()]
  94. list @0x1001000e0, head 0x100100120, tail 0x1001000b0, size 6
  95. node @0x100100120, data 0xcafebabe1, next 0x100100130, pos 0
  96. node @0x100100130, data 0xdecafbad2, next 0x100100080, pos 1
  97. node @0x100100080, data 0xdeadbeef3, next 0x100100090, pos 2
  98. node @0x100100090, data 0xbaadf00d4, next 0x1001000a0, pos 3
  99. node @0x1001000a0, data 0xc0debabe5, next 0x1001000b0, pos 4
  100. node @0x1001000b0, data 0xbadcab1e6, next 0x0, pos 5
  101.  
  102. -> checking data
  103. -> setting nonexistant nodes
  104. list @0x1001000e0, head 0x100100120, tail 0x1001000b0, size 6
  105. node @0x100100120, data 0xcafebabe1, next 0x100100130, pos 0
  106. node @0x100100130, data 0xdecafbad2, next 0x100100080, pos 1
  107. node @0x100100080, data 0xdeadbeef3, next 0x100100090, pos 2
  108. node @0x100100090, data 0xbaadf00d4, next 0x1001000a0, pos 3
  109. node @0x1001000a0, data 0xc0debabe5, next 0x1001000b0, pos 4
  110. node @0x1001000b0, data 0xbadcab1e6, next 0x0, pos 5
  111.  
  112. -> setting valid nodes
  113. list @0x1001000e0, head 0x100100120, tail 0x1001000b0, size 6
  114. node @0x100100120, data 0xbadcab1e6, next 0x100100130, pos 0
  115. node @0x100100130, data 0xc0debabe5, next 0x100100080, pos 1
  116. node @0x100100080, data 0xbaadf00d4, next 0x100100090, pos 2
  117. node @0x100100090, data 0xbaadf00d4, next 0x1001000a0, pos 3
  118. node @0x1001000a0, data 0xc0debabe5, next 0x1001000b0, pos 4
  119. node @0x1001000b0, data 0xcafebabe1, next 0x0, pos 5
Add Comment
Please, Sign In to add comment