diff options
author | Tom Tromey <tromey@cygnus.com> | 1999-10-22 19:43:41 +0000 |
---|---|---|
committer | Tom Tromey <tromey@gcc.gnu.org> | 1999-10-22 19:43:41 +0000 |
commit | b8c3c4f0146f82c900a995c8e98b83a2147115fd (patch) | |
tree | 5b2911a12a79d2934e95d0632e658c09f9826b4a /libjava/prims.cc | |
parent | 2fca54beb25b7aea46d0d7077df92ee7e3e051f6 (diff) | |
download | gcc-b8c3c4f0146f82c900a995c8e98b83a2147115fd.zip gcc-b8c3c4f0146f82c900a995c8e98b83a2147115fd.tar.gz gcc-b8c3c4f0146f82c900a995c8e98b83a2147115fd.tar.bz2 |
Makefile.in: Rebuilt.
* Makefile.in: Rebuilt.
* Makefile.am (java/lang/ClassLoader.h): New target.
* java/lang/natClassLoader.cc (_Jv_FindClass): Removed reference
to `redirect'.
* include/java-props.h (_Jv_Compiler_Properties): Changed
declaration.
* gcj/array.h (JvRunMain, _Jv_RunMain): Don't declare.
* include/jvm.h (_Jv_GCSetInitialHeapSize,
_Jv_GCSetMaximumHeapSize): Declare.
(JvRunMain, _Jv_RunMain): Declare.
(_Jv_SetMaximumHeapSize, _Jv_SetInitialHeapSize): Declare.
* nogc.cc (_Jv_GCSetInitialHeapSize): New function.
(_Jv_GCSetMaximumHeapSize): Likewise.
* boehm.cc (_Jv_GCSetInitialHeapSize): New function.
(_Jv_GCSetMaximumHeapSize): Likewise.
* prims.cc (parse_heap_size): New function.
(_Jv_SetInitialHeapSize): Likewise.
(_Jv_SetMaximumHeapSize): Likewise.
(_Jv_Compiler_Properties): New global.
* gij.cc (help): New function.
(version): Likewise.
(heap_size): Likewise.
(heap_max_size): Likewise.
(main): Parse arguments. Set _Jv_Compiler_Properties.
Include <config.h>, <java-props.h>.
(_Jv_Compiler_Properties): Removed.
From-SVN: r30133
Diffstat (limited to 'libjava/prims.cc')
-rw-r--r-- | libjava/prims.cc | 42 |
1 files changed, 35 insertions, 7 deletions
diff --git a/libjava/prims.cc b/libjava/prims.cc index e694e13..6e6c633 100644 --- a/libjava/prims.cc +++ b/libjava/prims.cc @@ -63,6 +63,9 @@ static java::lang::OutOfMemoryError *no_memory; // Largest representable size_t. #define SIZE_T_MAX ((size_t) (~ (size_t) 0)) +// Properties set at compile time. +const char **_Jv_Compiler_Properties; + #ifndef DISABLE_GETENV_PROPERTIES // Property key/value pairs. property_pair *_Jv_Environment_Properties; @@ -811,6 +814,38 @@ _Jv_RunMain (const char *class_name, int argc, const char **argv) java::lang::Runtime::getRuntime ()->exit (0); } + + +// Parse a string and return a heap size. +static size_t +parse_heap_size (const char *spec) +{ + char *end; + unsigned long val = strtoul (spec, &end, 10); + if (*spec == 'k' || *spec == 'K') + val *= 1000; + else if (*spec == 'm' || *spec == 'M') + val *= 1000000; + return (size_t) val; +} + +// Set the initial heap size. This might be ignored by the GC layer. +// This must be called before _Jv_RunMain. +void +_Jv_SetInitialHeapSize (const char *arg) +{ + size_t size = parse_heap_size (arg); + _Jv_GCSetInitialHeapSize (size); +} + +// Set the maximum heap size. This might be ignored by the GC layer. +// This must be called before _Jv_RunMain. +void +_Jv_SetMaximumHeapSize (const char *arg) +{ + size_t size = parse_heap_size (arg); + _Jv_GCSetMaximumHeapSize (size); +} @@ -885,10 +920,3 @@ _Jv_remJ (jlong dividend, jlong divisor) return dividend % divisor; } - - - - - - - |