utilities/standaloneallocator/README.txt
author hgs
Fri, 15 Oct 2010 17:30:59 -0400
changeset 16 3c88a81ff781
permissions -rw-r--r--
201041
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
16
hgs
parents:
diff changeset
     1
------------------------------
hgs
parents:
diff changeset
     2
This is the custom memory allocator for use with QtWebkit based killer apps for Symbian/S60. 
hgs
parents:
diff changeset
     3
------------------------------
hgs
parents:
diff changeset
     4
hgs
parents:
diff changeset
     5
Major features: 
hgs
parents:
diff changeset
     6
- faster than Symbian RHeap. O(1) operations vs. O(n) 
hgs
parents:
diff changeset
     7
- more space efficient for smaller allocations (i.e lower system RAM usage)
hgs
parents:
diff changeset
     8
- switches at run-time between 1 of 3 allocation algorithms based on requested alloc size
hgs
parents:
diff changeset
     9
hgs
parents:
diff changeset
    10
* How Symbian OS process startup works: 
hgs
parents:
diff changeset
    11
(from http://developer.symbian.org/wiki/index.php/Symbian_OS_Internals/3._Threads,_Processes_and_Libraries ) 
hgs
parents:
diff changeset
    12
 * Process entry point (__E32Startup) -> RunThread() -> UserHeap::SetupThreadHeap(). 
hgs
parents:
diff changeset
    13
 * SetupThreadHeap() is where we initialize our custom (heap) allocator.
hgs
parents:
diff changeset
    14
 * If this is first thread in the process, constructors for static data are called, followed by E32Main(). 
hgs
parents:
diff changeset
    15
 * If NOT first thread in process, the thread's entry point is called straight away. 
hgs
parents:
diff changeset
    16
 * NOTE: UserHeap::SetupThreadHeap() is called BEFORE static data is initialized
hgs
parents:
diff changeset
    17
 
hgs
parents:
diff changeset
    18
 
hgs
parents:
diff changeset
    19
Debugging support:
hgs
parents:
diff changeset
    20
hgs
parents:
diff changeset
    21
* To use standard Symbian/S60 memory analysis tools, comment out the call to UserHeap::SetupThreadHeap() and recompile the library. 
hgs
parents:
diff changeset
    22
  Then relink your application (.exe) with the updated library. This will make RHeap your default allocator once again. 
hgs
parents:
diff changeset
    23
hgs
parents:
diff changeset
    24
(from Shane Kearns) 
hgs
parents:
diff changeset
    25
* With a 9.4 (5.0) or later RND environment, you can use BTRACE by defining the required BTRACE macros (in the source, commented out).
hgs
parents:
diff changeset
    26
  This emits the same BTRACE entries as the default allocator, so you can do memory leak analysis using existing tools based on BTRACE.
hgs
parents:
diff changeset
    27
  For example, the promising but cancelled SAW. (which is still available inside nokia). 
hgs
parents:
diff changeset
    28
* Memory analysis tools based on dumping the heap to a file and doing post-mortem analysis won't work unless specifically designed for this allocator.
hgs
parents:
diff changeset
    29
hgs
parents:
diff changeset
    30
hgs
parents:
diff changeset
    31
hgs
parents:
diff changeset
    32