Rev 753 | Rev 1211 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 753 | Rev 1210 | ||
---|---|---|---|
Line 3... | Line 3... | ||
3 | ;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;; |
3 | ;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;; |
4 | ;; Distributed under terms of the GNU General Public License ;; |
4 | ;; Distributed under terms of the GNU General Public License ;; |
5 | ;; ;; |
5 | ;; ;; |
6 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
6 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
Line 7... | Line 7... | ||
7 | 7 | ||
Line 8... | Line 8... | ||
8 | $Revision: 753 $ |
8 | $Revision: 1210 $ |
9 | 9 | ||
10 | 10 | ||
Line 18... | Line 18... | ||
18 | 18 | ||
19 | ; temp |
19 | ; temp |
20 | ; esi= nb |
20 | ; esi= nb |
21 | ; ebx= idx |
21 | ; ebx= idx |
- | 22 | ; |
|
22 | ; |
23 | align 4 |
23 | malloc: |
24 | malloc: |
Line 24... | Line 25... | ||
24 | push esi |
25 | push esi |
Line 66... | Line 67... | ||
66 | ; if (B == F) |
67 | ; if (B == F) |
67 | cmp edi, eax |
68 | cmp edi, eax |
68 | jne @F |
69 | jne @F |
Line 69... | Line 70... | ||
69 | 70 | ||
- | 71 | btr [mst.smallmap], ebx |
|
70 | btr [mst.smallmap], ebx |
72 | align 4 |
Line 71... | Line 73... | ||
71 | @@: |
73 | @@: |
72 | 74 | ||
73 | ; B->fd = F; |
75 | ; B->fd = F; |
Line 88... | Line 90... | ||
88 | or ebp, 3 |
90 | or ebp, 3 |
89 | mov [edx+4], ebp |
91 | mov [edx+4], ebp |
Line 90... | Line 92... | ||
90 | 92 | ||
91 | pop edi |
93 | pop edi |
- | 94 | pop ebp |
|
92 | pop ebp |
95 | align 4 |
93 | .done: |
96 | .done: |
94 | pop esi |
97 | pop esi |
95 | mov [mst.mutex], 0 |
98 | mov [mst.mutex], 0 |
- | 99 | ret |
|
96 | ret |
100 | align 4 |
97 | .split: |
101 | .split: |
Line 98... | Line 102... | ||
98 | lea ebx, [edx+8] ;ebx=mem |
102 | lea ebx, [edx+8] ;ebx=mem |
99 | 103 | ||
Line 133... | Line 137... | ||
133 | mov [eax+8], edx ; r->fd = F; |
137 | mov [eax+8], edx ; r->fd = F; |
134 | mov [eax+12], ecx ; r->bk = B; |
138 | mov [eax+12], ecx ; r->bk = B; |
135 | mov eax, ebx |
139 | mov eax, ebx |
136 | pop esi |
140 | pop esi |
137 | ret |
141 | ret |
- | 142 | align 4 |
|
138 | .small: |
143 | .small: |
Line 139... | Line 144... | ||
139 | 144 | ||
140 | ; if (ms.treemap != 0 && (mem = malloc_small(nb)) != 0) |
- | |
- | 145 | ; if (ms.treemap != 0 && (mem = malloc_small(nb)) != 0) |
|
- | 146 | ;;;;;;;;;;; start a change |
|
- | 147 | mov eax,[mst.treemap] |
|
- | 148 | test eax,eax |
|
141 | 149 | ;;;;;;;;;;; end the change |
|
142 | cmp [mst.treemap], 0 |
150 | ; cmp [mst.treemap], 0 |
143 | je .from_top |
151 | jz .from_top |
144 | mov eax, esi |
152 | mov eax, esi |
145 | call malloc_small |
153 | call malloc_small |
146 | test eax, eax |
154 | test eax, eax |
147 | jz .from_top |
155 | jz .from_top |
148 | pop esi |
156 | pop esi |
149 | and [mst.mutex], 0 |
157 | and [mst.mutex], 0 |
- | 158 | ret |
|
150 | ret |
159 | align 4 |
Line 151... | Line 160... | ||
151 | .large: |
160 | .large: |
Line 152... | Line 161... | ||
152 | 161 | ||
153 | ; if (ms.treemap != 0 && (mem = malloc_large(nb)) != 0) |
162 | ; if (ms.treemap != 0 && (mem = malloc_large(nb)) != 0) |
Line 154... | Line 163... | ||
154 | 163 | ||
155 | cmp [mst.treemap], 0 |
164 | cmp [mst.treemap], 0 |
156 | je .from_top |
165 | je .from_top |
- | 166 | ||
157 | 167 | call malloc_large ;esi= nb |
|
Line 158... | Line 168... | ||
158 | call malloc_large ;esi= nb |
168 | test eax, eax |
Line 159... | Line 169... | ||
159 | test eax, eax |
169 | jne .done |
Line 185... | Line 195... | ||
185 | mov [ecx+4], esi |
195 | mov [ecx+4], esi |
186 | lea eax, [ecx+8] |
196 | lea eax, [ecx+8] |
187 | pop esi |
197 | pop esi |
188 | and [mst.mutex], 0 |
198 | and [mst.mutex], 0 |
189 | ret |
199 | ret |
- | 200 | align 4 |
|
190 | .fail: |
201 | .fail: |
191 | xor eax, eax |
202 | xor eax, eax |
192 | pop esi |
203 | pop esi |
193 | and [mst.mutex], 0 |
204 | and [mst.mutex], 0 |
194 | ret |
205 | ret |
Line 245... | Line 256... | ||
245 | ; ms.smallmap &= ~(1<< I); |
256 | ; ms.smallmap &= ~(1<< I); |
246 | shr ecx, 3 |
257 | shr ecx, 3 |
247 | cmp eax, edx |
258 | cmp eax, edx |
248 | jne @F |
259 | jne @F |
249 | and [mst.smallmap], ecx |
260 | and [mst.smallmap], ecx |
- | 261 | align 4 |
|
250 | @@: |
262 | @@: |
251 | mov [eax+12], edx ;F->bk = B; |
263 | mov [eax+12], edx ;F->bk = B; |
252 | mov [edx+8], eax ;B->fd = F |
264 | mov [edx+8], eax ;B->fd = F |
253 | jmp .next |
265 | jmp .next |
- | 266 | align 4 |
|
254 | .unlink_large: |
267 | .unlink_large: |
255 | mov edx, edi |
268 | mov edx, edi |
256 | call unlink_large_chunk |
269 | call unlink_large_chunk |
- | 270 | align 4 |
|
257 | .next: |
271 | .next: |
Line 258... | Line 272... | ||
258 | 272 | ||
Line 259... | Line 273... | ||
259 | ; if(next->head & PINUSE_BIT) |
273 | ; if(next->head & PINUSE_BIT) |
Line 282... | Line 296... | ||
282 | ; p->head = tsize | PINUSE_BIT; |
296 | ; p->head = tsize | PINUSE_BIT; |
Line 283... | Line 297... | ||
283 | 297 | ||
284 | or eax, 1 |
298 | or eax, 1 |
285 | mov [mst.top], edi |
299 | mov [mst.top], edi |
- | 300 | mov [edi+4], eax |
|
286 | mov [edi+4], eax |
301 | align 4 |
287 | .fail2: |
302 | .fail2: |
288 | and [mst.mutex], 0 |
303 | and [mst.mutex], 0 |
- | 304 | pop esi |
|
289 | pop esi |
305 | align 4 |
290 | .fail: |
306 | .fail: |
291 | pop edi |
307 | pop edi |
- | 308 | ret |
|
292 | ret |
309 | align 4 |
Line 293... | Line 310... | ||
293 | @@: |
310 | @@: |
Line 294... | Line 311... | ||
294 | 311 | ||
Line 310... | Line 327... | ||
310 | cmp edx, ebx |
327 | cmp edx, ebx |
311 | jne @F |
328 | jne @F |
312 | mov ecx, eax |
329 | mov ecx, eax |
313 | shr ecx, 3 |
330 | shr ecx, 3 |
314 | btr [mst.smallmap], ecx |
331 | btr [mst.smallmap], ecx |
- | 332 | align 4 |
|
315 | @@: |
333 | @@: |
316 | mov [edx+12], ebx ;F->bk = B |
334 | mov [edx+12], ebx ;F->bk = B |
Line 317... | Line 335... | ||
317 | 335 | ||
Line 331... | Line 349... | ||
331 | mov eax, esi |
349 | mov eax, esi |
332 | pop esi |
350 | pop esi |
333 | mov ecx, edi |
351 | mov ecx, edi |
334 | pop edi |
352 | pop edi |
335 | jmp insert_chunk |
353 | jmp insert_chunk |
- | 354 | align 4 |
|
336 | .unl_large: |
355 | .unl_large: |
Line 337... | Line 356... | ||
337 | 356 | ||
Line 338... | Line 357... | ||
338 | ; unlink_large_chunk((tchunkptr)next); |
357 | ; unlink_large_chunk((tchunkptr)next); |
Line 354... | Line 373... | ||
354 | mov eax, esi |
373 | mov eax, esi |
355 | pop esi |
374 | pop esi |
356 | mov ecx, edi |
375 | mov ecx, edi |
357 | pop edi |
376 | pop edi |
358 | jmp insert_chunk |
377 | jmp insert_chunk |
- | 378 | align 4 |
|
359 | .fix_next: |
379 | .fix_next: |
Line 360... | Line 380... | ||
360 | 380 | ||
361 | ; (p+psize)->prev_foot = psize; |
381 | ; (p+psize)->prev_foot = psize; |
362 | ; next->head &= ~PINUSE_BIT; |
382 | ; next->head &= ~PINUSE_BIT; |
Line 407... | Line 427... | ||
407 | mov [esi+8], edx ;P->fd = F |
427 | mov [esi+8], edx ;P->fd = F |
408 | mov [esi+12], eax ;P->bk = B |
428 | mov [esi+12], eax ;P->bk = B |
409 | pop esi |
429 | pop esi |
410 | and [mst.mutex], 0 |
430 | and [mst.mutex], 0 |
411 | ret |
431 | ret |
- | 432 | align 4 |
|
412 | .large: |
433 | .large: |
413 | mov ebx, eax |
434 | mov ebx, eax |
414 | call insert_large_chunk |
435 | call insert_large_chunk |
415 | pop esi |
436 | pop esi |
416 | and [mst.mutex], 0 |
437 | and [mst.mutex], 0 |
Line 455... | Line 476... | ||
455 | ; ms.treemap |= 1< |
476 | ; ms.treemap |= 1< |
456 | bts [mst.treemap], ecx |
477 | bts [mst.treemap], ecx |
457 | ; *H = X; |
478 | ; *H = X; |
458 | mov dword [edx], esi |
479 | mov dword [edx], esi |
459 | jmp .done |
480 | jmp .done |
- | 481 | align 4 |
|
460 | .tree: |
482 | .tree: |
Line 461... | Line 483... | ||
461 | 483 | ||
462 | ; T = *H; |
484 | ; T = *H; |
Line 473... | Line 495... | ||
473 | and ecx, edi |
495 | and ecx, edi |
474 | mov eax, ebx |
496 | mov eax, ebx |
475 | shl eax, cl ;eax= K |
497 | shl eax, cl ;eax= K |
Line 476... | Line 498... | ||
476 | 498 | ||
477 | jmp .loop |
499 | jmp .loop |
478 | 500 | align 4 |
|
Line 479... | Line 501... | ||
479 | .not_eq_size: |
501 | .not_eq_size: |
480 | 502 | ||
481 | ; C = &(T->child[(K >> 31) & 1]); |
503 | ; C = &(T->child[(K >> 31) & 1]); |
Line 490... | Line 512... | ||
490 | test edi, edi |
512 | test edi, edi |
491 | jz .insert_child |
513 | jz .insert_child |
Line 492... | Line 514... | ||
492 | 514 | ||
493 | ; T = *C; |
515 | ; T = *C; |
- | 516 | mov edx, edi |
|
494 | mov edx, edi |
517 | align 4 |
Line 495... | Line 518... | ||
495 | .loop: |
518 | .loop: |
496 | 519 | ||
Line 515... | Line 538... | ||
515 | 538 | ||
516 | and dword [esi+24], 0 |
539 | and dword [esi+24], 0 |
517 | mov [esi+8], eax |
540 | mov [esi+8], eax |
518 | mov [esi+12], edx |
541 | mov [esi+12], edx |
519 | ret |
542 | ret |
520 | 543 | align 4 |
|
Line 521... | Line 544... | ||
521 | .insert_child: |
544 | .insert_child: |
522 | 545 | ||
- | 546 | ; *C = X; |
|
523 | ; *C = X; |
547 | mov [ecx], esi |
Line 524... | Line 548... | ||
524 | mov [ecx], esi |
548 | align 4 |
525 | .done: |
549 | .done: |
Line 547... | Line 571... | ||
547 | 571 | ||
548 | mov ecx, [edx+8] ;F = X->fd |
572 | mov ecx, [edx+8] ;F = X->fd |
549 | mov [ecx+12], eax ;F->bk = R; |
573 | mov [ecx+12], eax ;F->bk = R; |
550 | mov [eax+8], ecx ;R->fd = F |
574 | mov [eax+8], ecx ;R->fd = F |
- | 575 | jmp .parent |
|
551 | jmp .parent |
576 | align 4 |
552 | @@: |
577 | @@: |
553 | mov eax, [edx+20] |
578 | mov eax, [edx+20] |
554 | test eax, eax |
579 | test eax, eax |
555 | push esi |
580 | push esi |
Line 558... | Line 583... | ||
558 | 583 | ||
559 | mov eax, [edx+16] |
584 | mov eax, [edx+16] |
560 | test eax, eax |
585 | test eax, eax |
561 | lea esi, [edx+16] |
586 | lea esi, [edx+16] |
- | 587 | je .l2 |
|
562 | je .l2 |
588 | align 4 |
563 | .loop: |
589 | .loop: |
564 | cmp dword [eax+20], 0 |
590 | cmp dword [eax+20], 0 |
565 | lea ecx, [eax+20] |
591 | lea ecx, [eax+20] |
Line 566... | Line 592... | ||
566 | jne @F |
592 | jne @F |
567 | 593 | ||
568 | cmp dword [eax+16], 0 |
594 | cmp dword [eax+16], 0 |
- | 595 | lea ecx, [eax+16] |
|
569 | lea ecx, [eax+16] |
596 | je .l1 |
570 | je .l1 |
597 | align 4 |
571 | @@: |
598 | @@: |
572 | mov eax, [ecx] |
599 | mov eax, [ecx] |
- | 600 | mov esi, ecx |
|
573 | mov esi, ecx |
601 | jmp .loop |
574 | jmp .loop |
602 | align 4 |
- | 603 | .l1: |
|
575 | .l1: |
604 | mov dword [esi], 0 |
576 | mov dword [esi], 0 |
605 | align 4 |
- | 606 | .l2: |
|
577 | .l2: |
607 | pop esi |
578 | pop esi |
608 | align 4 |
579 | .parent: |
609 | .parent: |
Line 580... | Line 610... | ||
580 | test edi, edi |
610 | test edi, edi |
Line 591... | Line 621... | ||
591 | 621 | ||
592 | mov ecx, [edx+28] |
622 | mov ecx, [edx+28] |
593 | btr [mst.treemap], ecx |
623 | btr [mst.treemap], ecx |
594 | pop edi |
624 | pop edi |
- | 625 | ret |
|
595 | ret |
626 | align 4 |
596 | .l3: |
627 | .l3: |
597 | cmp [edi+16], edx |
628 | cmp [edi+16], edx |
Line 598... | Line 629... | ||
598 | jne @F |
629 | jne @F |
599 | 630 | ||
- | 631 | mov [edi+16], eax |
|
600 | mov [edi+16], eax |
632 | jmp .l4 |
601 | jmp .l4 |
633 | align 4 |
- | 634 | @@: |
|
602 | @@: |
635 | mov [edi+20], eax |
603 | mov [edi+20], eax |
636 | align 4 |
604 | .l4: |
637 | .l4: |
- | 638 | test eax, eax |
|
605 | test eax, eax |
639 | je .done |
606 | je .done |
640 | align 4 |
607 | .l5: |
641 | .l5: |
608 | mov [eax+24], edi |
642 | mov [eax+24], edi |
609 | mov ecx, [edx+16] |
643 | mov ecx, [edx+16] |
Line 610... | Line 644... | ||
610 | test ecx, ecx |
644 | test ecx, ecx |
611 | je .l6 |
645 | je .l6 |
- | 646 | ||
612 | 647 | mov [eax+16], ecx |
|
613 | mov [eax+16], ecx |
648 | mov [ecx+24], eax |
614 | mov [ecx+24], eax |
649 | align 4 |
615 | .l6: |
650 | .l6: |
Line 616... | Line 651... | ||
616 | mov edx, [edx+20] |
651 | mov edx, [edx+20] |
617 | test edx, edx |
652 | test edx, edx |
- | 653 | je .done |
|
618 | je .done |
654 | |
619 | 655 | mov [eax+20], edx |
|
620 | mov [eax+20], edx |
656 | mov [edx+24], eax |
Line 621... | Line 657... | ||
621 | mov [edx+24], eax |
657 | align 4 |
Line 639... | Line 675... | ||
639 | ; rsize = (t->head & ~INUSE_BITS) - nb; |
675 | ; rsize = (t->head & ~INUSE_BITS) - nb; |
Line 640... | Line 676... | ||
640 | 676 | ||
641 | mov edi, [ecx+4] |
677 | mov edi, [ecx+4] |
642 | and edi, -4 |
678 | and edi, -4 |
- | 679 | sub edi, esi |
|
643 | sub edi, esi |
680 | align 4 |
644 | .loop: |
681 | .loop: |
- | 682 | mov ebx, ecx |
|
645 | mov ebx, ecx |
683 | align 4 |
Line 646... | Line 684... | ||
646 | .loop_1: |
684 | .loop_1: |
Line 647... | Line 685... | ||
647 | 685 | ||
648 | ; while ((t = leftmost_child(t)) != 0) |
686 | ; while ((t = leftmost_child(t)) != 0) |
649 | 687 | ||
650 | mov eax, [ecx+16] |
688 | mov eax, [ecx+16] |
651 | test eax, eax |
689 | test eax, eax |
- | 690 | jz @F |
|
652 | jz @F |
691 | mov ecx, eax |
653 | mov ecx, eax |
692 | jmp .l1 |
- | 693 | align 4 |
|
654 | jmp .l1 |
694 | @@: |
655 | @@: |
695 | mov ecx, [ecx+20] |
656 | mov ecx, [ecx+20] |
696 | align 4 |
Line 657... | Line 697... | ||
657 | .l1: |
697 | .l1: |
Line 702... | Line 742... | ||
702 | or dword [eax], 1 |
742 | or dword [eax], 1 |
703 | pop ebp |
743 | pop ebp |
Line 704... | Line 744... | ||
704 | 744 | ||
705 | lea eax, [ebx+8] |
745 | lea eax, [ebx+8] |
- | 746 | ret |
|
706 | ret |
747 | align 4 |
Line 707... | Line 748... | ||
707 | .split: |
748 | .split: |
708 | 749 | ||
709 | ; v->head = nb|PINUSE_BIT|CINUSE_BIT; |
750 | ; v->head = nb|PINUSE_BIT|CINUSE_BIT; |
Line 734... | Line 775... | ||
734 | mov [esi+12], eax |
775 | mov [esi+12], eax |
735 | mov [esi+8], edx |
776 | mov [esi+8], edx |
736 | pop ebp |
777 | pop ebp |
737 | lea eax, [ebx+8] |
778 | lea eax, [ebx+8] |
738 | ret |
779 | ret |
- | 780 | align 4 |
|
739 | .large: |
781 | .large: |
740 | lea eax, [ebx+8] |
782 | lea eax, [ebx+8] |
741 | push eax |
783 | push eax |
742 | mov ebx, edi |
784 | mov ebx, edi |
743 | call insert_large_chunk |
785 | call insert_large_chunk |
Line 787... | Line 829... | ||
787 | 829 | ||
788 | cmp ecx, 31 |
830 | cmp ecx, 31 |
789 | jne @F |
831 | jne @F |
790 | xor ecx, ecx |
832 | xor ecx, ecx |
- | 833 | jmp .l1 |
|
791 | jmp .l1 |
834 | align 4 |
792 | @@: |
835 | @@: |
793 | mov edx, ecx |
836 | mov edx, ecx |
794 | shr edx, 1 |
837 | shr edx, 1 |
795 | mov ecx, 37 |
838 | mov ecx, 37 |
- | 839 | sub ecx, edx |
|
796 | sub ecx, edx |
840 | align 4 |
797 | .l1: |
841 | .l1: |
798 | mov edx, ebx |
842 | mov edx, ebx |
Line 799... | Line 843... | ||
799 | shl edx, cl |
843 | shl edx, cl |
800 | 844 | ||
- | 845 | ; rst = 0; |
|
801 | ; rst = 0; |
846 | mov [.rst], ebp |
Line 802... | Line 847... | ||
802 | mov [.rst], ebp |
847 | align 4 |
Line 803... | Line 848... | ||
803 | .loop: |
848 | .loop: |
Line 817... | Line 862... | ||
817 | 862 | ||
818 | test ecx, ecx |
863 | test ecx, ecx |
819 | mov ebp, eax |
864 | mov ebp, eax |
820 | mov edi, ecx |
865 | mov edi, ecx |
- | 866 | je .l2 |
|
821 | je .l2 |
867 | align 4 |
Line 822... | Line 868... | ||
822 | @@: |
868 | @@: |
Line 823... | Line 869... | ||
823 | 869 | ||
Line 838... | Line 884... | ||
838 | cmp ecx, eax |
884 | cmp ecx, eax |
839 | jz @F |
885 | jz @F |
Line 840... | Line 886... | ||
840 | 886 | ||
841 | ; rst = rt; |
887 | ; rst = rt; |
- | 888 | mov [.rst], ecx |
|
842 | mov [.rst], ecx |
889 | align 4 |
843 | @@: |
890 | @@: |
Line 844... | Line 891... | ||
844 | ; if (t == 0) |
891 | ; if (t == 0) |
845 | 892 | ||
Line 846... | Line 893... | ||
846 | test eax, eax |
893 | test eax, eax |
Line 847... | Line 894... | ||
847 | jz @F |
894 | jz @F |
848 | 895 | ||
- | 896 | ; sizebits <<= 1; |
|
849 | ; sizebits <<= 1; |
897 | |
850 | 898 | add edx, edx |
|
851 | add edx, edx |
899 | jmp .loop |
- | 900 | align 4 |
|
852 | jmp .loop |
901 | @@: |
853 | @@: |
902 | ; t = rst; |
Line 854... | Line 903... | ||
854 | ; t = rst; |
903 | mov eax, [.rst] |
855 | mov eax, [.rst] |
904 | align 4 |
856 | .l2: |
905 | .l2: |
857 | ; if (t == 0 && v == 0) |
906 | ; if (t == 0 && v == 0) |
858 | 907 | ||
- | 908 | test eax, eax |
|
859 | test eax, eax |
909 | jne .l4 |
Line 860... | Line 910... | ||
860 | jne .l4 |
910 | test ebp, ebp |
861 | test ebp, ebp |
911 | jne .l7 |
Line 872... | Line 922... | ||
872 | jz @F |
922 | jz @F |
Line 873... | Line 923... | ||
873 | 923 | ||
874 | bsf eax, edx |
924 | bsf eax, edx |
875 | ; t = ms.treebins[i]; |
925 | ; t = ms.treebins[i]; |
- | 926 | mov eax, [mst.treebins+eax*4] |
|
876 | mov eax, [mst.treebins+eax*4] |
927 | align 4 |
Line 877... | Line 928... | ||
877 | @@: |
928 | @@: |
878 | 929 | ||
879 | ; while (t != 0) |
930 | ; while (t != 0) |
- | 931 | test eax, eax |
|
880 | test eax, eax |
932 | jz .l5 |
Line 881... | Line 933... | ||
881 | jz .l5 |
933 | align 4 |
Line 882... | Line 934... | ||
882 | .l4: |
934 | .l4: |
Line 894... | Line 946... | ||
894 | ; rsize = trem; |
946 | ; rsize = trem; |
Line 895... | Line 947... | ||
895 | 947 | ||
896 | mov edi, ecx |
948 | mov edi, ecx |
897 | ; v = t; |
949 | ; v = t; |
- | 950 | mov ebp, eax |
|
898 | mov ebp, eax |
951 | align 4 |
Line 899... | Line 952... | ||
899 | @@: |
952 | @@: |
Line 900... | Line 953... | ||
900 | 953 | ||
901 | ; t = leftmost_child(t); |
954 | ; t = leftmost_child(t); |
902 | 955 | ||
903 | mov ecx, [eax+16] |
956 | mov ecx, [eax+16] |
904 | test ecx, ecx |
957 | test ecx, ecx |
- | 958 | je @F |
|
905 | je @F |
959 | mov eax, ecx |
906 | mov eax, ecx |
960 | jmp .l6 |
- | 961 | align 4 |
|
907 | jmp .l6 |
962 | @@: |
Line 908... | Line 963... | ||
908 | @@: |
963 | mov eax, [eax+20] |
Line 909... | Line 964... | ||
909 | mov eax, [eax+20] |
964 | align 4 |
910 | .l6: |
965 | .l6: |
- | 966 | ||
911 | 967 | ; while (t != 0) |
|
Line 912... | Line 968... | ||
912 | ; while (t != 0) |
968 | |
Line 913... | Line 969... | ||
913 | 969 | test eax, eax |
|
914 | test eax, eax |
970 | jne .l4 |
- | 971 | align 4 |
|
915 | jne .l4 |
972 | .l5: |
Line 916... | Line 973... | ||
916 | .l5: |
973 | |
917 | 974 | ; if (v != 0) |
|
Line 947... | Line 1004... | ||
947 | lea eax, [ebp+8] |
1004 | lea eax, [ebp+8] |
948 | add esp, 8 |
1005 | add esp, 8 |
949 | pop edi |
1006 | pop edi |
950 | pop ebp |
1007 | pop ebp |
951 | ret |
1008 | ret |
- | 1009 | align 4 |
|
952 | .large: |
1010 | .large: |
Line 953... | Line 1011... | ||
953 | 1011 | ||
954 | ; v->head = nb|PINUSE_BIT|CINUSE_BIT; |
1012 | ; v->head = nb|PINUSE_BIT|CINUSE_BIT; |
Line 971... | Line 1029... | ||
971 | lea eax, [ebp+8] |
1029 | lea eax, [ebp+8] |
972 | add esp, 8 |
1030 | add esp, 8 |
973 | pop edi |
1031 | pop edi |
974 | pop ebp |
1032 | pop ebp |
975 | ret |
1033 | ret |
- | 1034 | align 4 |
|
976 | .done: |
1035 | .done: |
977 | add esp, 8 |
1036 | add esp, 8 |
978 | pop edi |
1037 | pop edi |
979 | pop ebp |
1038 | pop ebp |
980 | xor eax, eax |
1039 | xor eax, eax |
Line 987... | Line 1046... | ||
987 | 1046 | ||
988 | mov [mst.top], eax |
1047 | mov [mst.top], eax |
989 | mov [mst.topsize], 128*1024 |
1048 | mov [mst.topsize], 128*1024 |
990 | mov dword [eax+4], (128*1024) or 1 |
1049 | mov dword [eax+4], (128*1024) or 1 |
- | 1050 | mov eax, mst.smallbins |
|
991 | mov eax, mst.smallbins |
1051 | align 4 |
992 | @@: |
1052 | @@: |
993 | mov [eax+8], eax |
1053 | mov [eax+8], eax |
994 | mov [eax+12], eax |
1054 | mov [eax+12], eax |
995 | add eax, 16 |
1055 | add eax, 16 |