Import boehm-gc snapshot, taken from
[official-gcc.git] / boehm-gc / extra / symbian.cpp
blob29a960d83d88477263d1d3d3f4a6607c789e3d6e
2 #include <e32cmn.h>
3 #include <e32std.h>
4 #include <f32file.h>
5 #include <aknutils.h>
6 #include <stdlib.h>
7 #include <string.h>
9 #ifdef __cplusplus
10 extern "C" {
11 #endif
13 int GC_get_main_symbian_stack_base()
15 TThreadStackInfo aInfo;
16 TInt err = RThread().StackInfo(aInfo);
17 if ( !err )
19 return aInfo.iBase;
21 else
23 return 0;
27 char* GC_get_private_path_and_zero_file()
29 // always on c: drive
30 RFs fs;
31 fs.Connect();
32 fs.CreatePrivatePath( EDriveC );
33 TFileName path;
34 fs.PrivatePath( path );
35 fs.Close();
36 _LIT( KCDrive, "c:" );
37 path.Insert( 0, KCDrive );
40 //convert to char*, assume ascii
41 TBuf8<KMaxFileName> path8;
42 path8.Copy( path );
43 _LIT8( KZero8, "zero" );
44 path8.Append( KZero8 );
46 size_t size = path8.Length() + 1;
47 char* copyChar = (char*) malloc( size );
48 memcpy( copyChar, path8.PtrZ(), size );
50 return copyChar; // ownership passed
53 #ifdef __cplusplus
55 #endif