Rev 3598 | Rev 3742 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3598 | Rev 3681 | ||
---|---|---|---|
Line 3... | Line 3... | ||
3 | ;; Copyright (C) KolibriOS team 2011-2012. All rights reserved. ;; |
3 | ;; Copyright (C) KolibriOS team 2011-2012. 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: 3598 $ |
8 | $Revision: 3681 $ |
9 | 9 | ||
10 | ; ============================================================================= |
10 | ; ============================================================================= |
11 | ; ================================= Constants ================================= |
11 | ; ================================= Constants ================================= |
Line 347... | Line 347... | ||
347 | xor eax, eax ; the argument of malloc() is in eax |
347 | xor eax, eax ; the argument of malloc() is in eax |
348 | @@: |
348 | @@: |
349 | inc eax |
349 | inc eax |
350 | cmp byte [ebx+eax-1], 0 |
350 | cmp byte [ebx+eax-1], 0 |
351 | jnz @b |
351 | jnz @b |
352 | ; 2b. Call the heap manager. Note that it can change ebx. |
352 | ; 2b. Call the heap manager. |
353 | push ebx |
- | |
354 | call malloc |
353 | call malloc |
355 | pop ebx |
- | |
356 | ; 2c. Check the result. If allocation failed, go to 7. |
354 | ; 2c. Check the result. If allocation failed, go to 7. |
357 | pop esi ; restore allocated pointer to DISK |
355 | pop esi ; restore allocated pointer to DISK |
358 | test eax, eax |
356 | test eax, eax |
359 | jz .free |
357 | jz .free |
360 | ; 2d. Store the allocated pointer to the DISK structure. |
358 | ; 2d. Store the allocated pointer to the DISK structure. |