diff options
author | bryce <bryce@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-11-17 20:25:57 +0000 |
---|---|---|
committer | bryce <bryce@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-11-17 20:25:57 +0000 |
commit | 1bc39a9bde3aae23c62166be8b641e79e5843d58 (patch) | |
tree | 5e88137f0a78a8faff6c52f9de564f61a19bcecd /libjava/prims.cc | |
parent | 069fa9335fb98c207811e6968223d8475f92909e (diff) | |
download | gcc-1bc39a9bde3aae23c62166be8b641e79e5843d58.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@107132 138bc75d-0d04-0410-961f-82ee72b054a4
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 ba5c9efd260..490d2b1c127 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) |