~ubuntu-branches/ubuntu/feisty/fpc/feisty

« back to all changes in this revision

Viewing changes to rtl/morphos/sysheap.inc

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2007-01-27 20:08:50 UTC
  • mfrom: (1.2.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20070127200850-9mrptaqqjsx9nwa7
Tags: 2.0.4-5
* Fixed Build-Depends.
* Add myself to Uploaders in debian/control.
* Make sure that the sources are really patched before building them.
* Build unit 'libc' on powerpc too.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
{
2
 
    $Id: sysheap.inc,v 1.1 2005/02/07 21:30:12 peter Exp $
3
2
    This file is part of the Free Pascal run time library.
4
 
    Copyright (c) 2001 by Free Pascal development team
 
3
    Copyright (c) 2005 by Free Pascal development team
5
4
 
6
 
    This file implements all the base types and limits required
7
 
    for a minimal POSIX compliant subset required to port the compiler
8
 
    to a new OS.
 
5
    Low level memory functions
9
6
 
10
7
    See the file COPYING.FPC, included in this distribution,
11
8
    for details about the copyright.
16
13
 
17
14
 **********************************************************************}
18
15
 
 
16
{ Enable this for memory allocation debugging }
 
17
{DEFINE MOSFPC_MEMDEBUG}
 
18
 
19
19
{*****************************************************************************
20
20
      OS Memory allocation / deallocation
21
21
 ****************************************************************************}
22
22
 
23
23
function SysOSAlloc(size: ptrint): pointer;
 
24
{$IFDEF MOSFPC_MEMDEBUG}
 
25
var values: array[0..2] of dword;
 
26
{$ENDIF}
24
27
begin
25
28
  result:=AllocPooled(MOS_heapPool,size);
 
29
{$IFDEF MOSFPC_MEMDEBUG}
 
30
  values[0]:=dword(result);
 
31
  values[1]:=dword(size);
 
32
  values[2]:=DWord(Sptr-StackBottom);
 
33
  RawDoFmt('FPC_MEM_DEBUG: $%lx:=SysOSAlloc(%ld), free stack: %ld bytes'+#10,@values,pointer(1),nil);
 
34
{$ENDIF}
26
35
end;
27
36
 
28
37
{$define HAS_SYSOSFREE}
29
38
 
30
39
procedure SysOSFree(p: pointer; size: ptrint);
 
40
{$IFDEF MOSFPC_MEMDEBUG}
 
41
var values: array[0..2] of dword;
 
42
{$ENDIF}
31
43
begin
32
44
  FreePooled(MOS_heapPool,p,size);
 
45
{$IFDEF MOSFPC_MEMDEBUG}
 
46
  values[0]:=dword(p);
 
47
  values[1]:=dword(size);
 
48
  values[2]:=DWord(Sptr-StackBottom);
 
49
  RawDoFmt('FPC_MEM_DEBUG: SysOSFree($%lx,%ld), free stack: %ld bytes'+#10,@values,pointer(1),nil);
 
50
{$ENDIF}
33
51
end;
34
 
 
35
 
 
36
 
{
37
 
   $Log: sysheap.inc,v $
38
 
   Revision 1.1  2005/02/07 21:30:12  peter
39
 
     * system unit updated
40
 
 
41
 
   Revision 1.1  2005/02/06 16:57:18  peter
42
 
     * threads for go32v2,os,emx,netware
43
 
 
44
 
   Revision 1.1  2005/02/06 13:06:20  peter
45
 
     * moved file and dir functions to sysfile/sysdir
46
 
     * win32 thread in systemunit
47
 
 
48
 
}
49