Subversion Repositories Kolibri OS

Rev

Rev 617 | Rev 627 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 617 Rev 626
Line 584... Line 584...
584
 
584
 
585
;-----------------------------------------------------------------------------
585
;-----------------------------------------------------------------------------
586
proc mem.Alloc,size ;/////////////////////////////////////////////////////////
586
proc mem.Alloc,size ;/////////////////////////////////////////////////////////
587
;-----------------------------------------------------------------------------
587
;-----------------------------------------------------------------------------
588
	push	ebx ecx
588
	push	ebx ecx
589
	mov	eax,[size]
589
	mov	ecx,[size]
590
	lea	ecx,[eax+4+4095]
590
	add	ecx,4+4095
591
	and	ecx,not 4095
591
	and	ecx,not 4095
592
	mcall	68,12
592
	mcall	68,12
593
	add	ecx,-4
593
	add	ecx,-4
594
	mov	[eax],ecx
594
	mov	[eax],ecx
595
	add	eax,4
595
	add	eax,4
596
	pop	ecx ebx
596
	pop	ecx ebx
597
	ret
597
	ret
598
@^
598
@^
-
 
599
	push	ebx ecx
-
 
600
	mov	eax,[size]
-
 
601
	lea	ecx,[eax+4+4095]
599
	push	ebx ecx
602
	and	ecx,not 4095
-
 
603
	mcall	68,12
-
 
604
	add	ecx,-4
-
 
605
	mov	[eax],ecx
600
	mcall	68,12,[size]
606
	add	eax,4
601
	pop	ecx ebx
607
	pop	ecx ebx
602
	ret
608
	ret
603
^@
609
^@
Line 604... Line 610...
604
endp
610
endp
605
 
611
 
606
;-----------------------------------------------------------------------------
612
;-----------------------------------------------------------------------------
-
 
613
proc mem.ReAlloc,mptr,size ;//////////////////////////////////////////////////
-
 
614
;-----------------------------------------------------------------------------
-
 
615
@^
-
 
616
	push	ebx ecx edx
-
 
617
	mov	ecx,[size]
-
 
618
	add	ecx,4+4095
-
 
619
	and	ecx,not 4095
-
 
620
	mov	edx,[mptr]
-
 
621
	add	edx,-4
-
 
622
	mcall	68,20
-
 
623
	add	ecx,-4
-
 
624
	mov	[eax],ecx
-
 
625
	add	eax,4
-
 
626
	pop	edx ecx ebx
607
proc mem.ReAlloc,mptr,size ;//////////////////////////////////////////////////
627
	ret
608
;-----------------------------------------------------------------------------
628
^@
609
	push	ebx ecx esi edi eax
629
	push	ebx ecx esi edi eax
610
	mov	eax,[mptr]
630
	mov	eax,[mptr]
611
	mov	ebx,[size]
631
	mov	ebx,[size]
Line 634... Line 654...
634
	xchg	eax,[esp]
654
	xchg	eax,[esp]
635
	stdcall mem.Free,eax
655
	stdcall mem.Free,eax
636
  .exit:
656
  .exit:
637
	pop	eax edi esi ecx ebx
657
	pop	eax edi esi ecx ebx
638
	ret
658
	ret
639
@^
-
 
640
	push	ebx ecx edx
-
 
641
	mcall	68,20,[size],[mptr]
-
 
642
	pop	edx ecx ebx
-
 
643
	ret
-
 
644
^@
-
 
645
endp
659
endp
Line 646... Line 660...
646
 
660
 
647
;-----------------------------------------------------------------------------
661
;-----------------------------------------------------------------------------
648
proc mem.Free,mptr ;//////////////////////////////////////////////////////////
662
proc mem.Free,mptr ;//////////////////////////////////////////////////////////
649
;-----------------------------------------------------------------------------
663
;-----------------------------------------------------------------------------
650
	push	ebx ecx
664
	push	ebx ecx
651
	mov	eax,[mptr]
665
	mov	ecx,[mptr]
652
	lea	ecx,[eax-4]
666
	add	ecx,-4
653
	mcall	68,13
667
	mcall	68,13
654
	pop	ecx ebx
668
	pop	ecx ebx
655
	ret
669
	ret
656
@^
670
@^
-
 
671
	push	ebx ecx
-
 
672
	mov	eax,[mptr]
657
	push	ebx ecx
673
	lea	ecx,[eax-4]
658
	mcall	68,13,[mptr]
674
	mcall	68,13
659
	pop	ecx ebx
675
	pop	ecx ebx
660
	ret
676
	ret
661
^@
677
^@