Subversion Repositories Kolibri OS

Rev

Rev 553 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 553 Rev 704
Line 27... Line 27...
27
* Description:  Heap growing routines - allocate near heap memory from OS.
27
* Description:  Heap growing routines - allocate near heap memory from OS.
28
*
28
*
29
****************************************************************************/
29
****************************************************************************/
Line 30... Line -...
30
 
-
 
31
 
30
 
32
//#include "dll.h"        // needs to be first
31
 
33
#include "variety.h"
32
#include "variety.h"
34
#include 
33
#include 
35
#include 
34
#include 
Line 43... Line 42...
43
#endif
42
#endif
44
#if defined(__CALL21__)
43
#if defined(__CALL21__)
45
// #include "tinyio.h"
44
// #include "tinyio.h"
46
#endif
45
#endif
47
#if defined(__WINDOWS_286__) || defined(__NT__)
46
#if defined(__WINDOWS_286__) || defined(__NT__)
48
void* _stdcall UserAlloc(int size);
-
 
49
 
-
 
50
// #include "windows.h"
47
 #include "kolibri.h"
51
#endif
48
#endif
52
#if defined(__OS2__)
49
#if defined(__OS2__)
53
// #include 
50
// #include 
54
#endif
51
#endif
55
#if defined(__WINDOWS_386__)
52
#if defined(__WINDOWS_386__)
Line 402... Line 399...
402
        brk_value = (unsigned)p;
399
        brk_value = (unsigned)p;
403
    }
400
    }
404
#elif defined(__NT__)
401
#elif defined(__NT__)
405
//    brk_value = (unsigned) VirtualAlloc( NULL, amount, MEM_COMMIT,
402
//    brk_value = (unsigned) VirtualAlloc( NULL, amount, MEM_COMMIT,
406
//                                        PAGE_EXECUTE_READWRITE );
403
//                                        PAGE_EXECUTE_READWRITE );
407
      brk_value = (unsigned) UserAlloc (amount );
404
      brk_value = (unsigned) user_alloc(amount );
Line 408... Line 405...
408
      
405
      
409
    //brk_value = (unsigned) LocalAlloc( LMEM_FIXED, amount );
406
    //brk_value = (unsigned) LocalAlloc( LMEM_FIXED, amount );
410
    if( brk_value == 0 ) {
407
    if( brk_value == 0 ) {
411
        return( 0 );
408
        return( 0 );