diff options
author | Bryce McKinlay <mckinlay@redhat.com> | 2005-11-17 20:25:57 +0000 |
---|---|---|
committer | Bryce McKinlay <bryce@gcc.gnu.org> | 2005-11-17 20:25:57 +0000 |
commit | 11922361e4a39efa05cc2a807d656dc5bfb858b3 (patch) | |
tree | 5e88137f0a78a8faff6c52f9de564f61a19bcecd /libjava/prims.cc | |
parent | f9314d012c1b213b95ee71a99b9edbe9be0e9118 (diff) | |
download | gcc-11922361e4a39efa05cc2a807d656dc5bfb858b3.zip gcc-11922361e4a39efa05cc2a807d656dc5bfb858b3.tar.gz gcc-11922361e4a39efa05cc2a807d656dc5bfb858b3.tar.bz2 |
Implement -Xss.
* include/jvm.h (gcj::stack_size): Declare.
(_Jv_StackSize): Declare.
* posix-threads.cc (_Jv_InitThreads): Validate gcj::stack_size.
(_Jv_ThreadStart): Set stack size if specified.
* prims.cc (gcj::stack_size): Define.
(parse_memory_size): Renamed from parse_heap_size.
(_Jv_SetStackSize): Parse stack size argument and set
gcj::stack_size.
From-SVN: r107132
Diffstat (limited to 'libjava/prims.cc')
-rw-r--r-- | libjava/prims.cc | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/libjava/prims.cc b/libjava/prims.cc index ba5c9ef..490d2b1 100644 --- a/libjava/prims.cc +++ b/libjava/prims.cc @@ -959,6 +959,9 @@ namespace gcj // When true, enable the bytecode verifier and BC-ABI type verification. bool verifyClasses = true; + + // Thread stack size specified by the -Xss runtime argument. + size_t stack_size = 0; } // We accept all non-standard options accepted by Sun's java command, @@ -1045,7 +1048,7 @@ parse_x_arg (char* option_string) } else if (! strncmp (option_string, "ss", 2)) { - // FIXME: set thread stack size + _Jv_SetStackSize (option_string + 2); } else if (! strcmp (option_string, "X:+UseAltSigs")) { @@ -1407,7 +1410,7 @@ JvRunMain (jclass klass, int argc, const char **argv) // Parse a string and return a heap size. static size_t -parse_heap_size (const char *spec) +parse_memory_size (const char *spec) { char *end; unsigned long val = strtoul (spec, &end, 10); @@ -1423,7 +1426,7 @@ parse_heap_size (const char *spec) void _Jv_SetInitialHeapSize (const char *arg) { - size_t size = parse_heap_size (arg); + size_t size = parse_memory_size (arg); _Jv_GCSetInitialHeapSize (size); } @@ -1432,11 +1435,16 @@ _Jv_SetInitialHeapSize (const char *arg) void _Jv_SetMaximumHeapSize (const char *arg) { - size_t size = parse_heap_size (arg); + size_t size = parse_memory_size (arg); _Jv_GCSetMaximumHeapSize (size); } - +void +_Jv_SetStackSize (const char *arg) +{ + size_t size = parse_memory_size (arg); + gcj::stack_size = size; +} void * _Jv_Malloc (jsize size) |