Index: working_vm/vm/port/doc/PortReadme.htm =================================================================== --- working_vm/vm/port/doc/PortReadme.htm (revision 648251) +++ working_vm/vm/port/doc/PortReadme.htm (working copy) @@ -67,32 +67,103 @@

2. Directory structure

Porting functionality is split to several groups (atomics, file I/O, mempools, etc). Each group has a base directory, which contains subdirectories with actual code. These subdirectories are named after the platforms and/or architectures they are compiled on. If there is a strong dependency on both OS and machine architecture, the subdirectory name should combine both. For example: -
-   Port
-	|
-	 -> file_io
-	|	|
-	|	 -> linux
-	|	|
-	|	 -> windows
-	|
-	 -> atomics
-		|
-		 -> linux_em64t
-		|
-		 -> linux_ia32
-		|
-		 -> windows
+
port
+|->build
+|->doc
+|->include
+|  ->tl
+ ->src
+  |->atomic
+  | |->linux
+  | |->linux_ipf
+  |  ->win
+  |->barriers
+  |  ->linux_ipf
+  |->crash_handler
+  | |->em64t
+  | |->ia32
+  | |->include
+  | |->ipf
+  | |->linux
+  | |  ->include
+  |  ->win
+  |->disasm
+  | |->linux
+  |  ->win
+  |->encoder
+  |  ->ia32_em64t
+  |->file_io
+  | |->linux
+  |  ->win
+  |->lil
+  |  ->em64t
+  |->logger
+  |->malloc
+  |->memaccess
+  | |->linux
+  |  ->win
+  |->misc
+  | |->linux
+  |  ->win
+  |->modules
+  | |->linux
+  |  ->win
+  |->signals
+  | |->include
+  | |->linux
+  |  ->win
+  |->thread
+  | |->linux
+  |  ->win
+  |->time
+  |->tl
+   ->vmem
+    |->linux
+     ->win	 
 
+

+Public headers are kept in a separate base directory named include. Implementation headers may be kept in source directories. -Public headers are kept in a separate base directory named include. Implementation headers may be kept in source directories? +

3. Memory management

-

3. Build system

+Port layer contains wrappers for standard memory allocation functions placed at port_malloc.h file. +They are presented as defines with names like STD_MALLOC for malloc, STD_FREE for free etc. +By default, they are simply equal to relative functions, but if _MEMMGR is defined then they are replaced with +other set of functions like port_malloc, port_free etc. +These functions provide additional functionality at the expense of lower performance. +

+New provided features: -Currently we reuse VM build system based on MakeCommon.
+

+ +To switch on allocation and de-allocation logging _MEMMGR_LOG macro should be defined. +This macro also enables double free calling notifications. +For the final not freed + memory report providing _MEMMGR_REPORT definition should be used. +

+Currently place for stress memory allocator is defined, but it is not implemented yet, only redirects to standard malloc. +To switch on stress allocation STRESS_MALLOC macro should be defined. +

+Memory management module couldn't use port logging, because it lead to infinite recursion. Its own primitive logging system uses file in current directory with name malloc.log for both logging and reporting. +Different file name and location could be set via MALLOC_LOG_FILE_NAME definition. +

+Used memory could be obtained by means of java.lang.management interface. +It is presented as non-heap memory pool with name Native Memory Pool. +Different pool name could be set by means of NATIVE_POOL_NAME redefinition. + + +

4. Build system

+ +Currently we reuse VM build system.
TODO - document platform defines and macros. -

4. APR issues

+

5. APR issues