changeset 8842:a27880c1288b

8077420: Build failure with SS12u4 Reviewed-by: dholmes, lfoltan
author stefank
date Tue, 14 Apr 2015 11:40:13 +0200
parents d8af86b0b638
children ca4663e58916
files src/share/vm/utilities/stack.hpp src/share/vm/utilities/stack.inline.hpp
diffstat 2 files changed, 6 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/utilities/stack.hpp	Tue Jul 08 13:52:29 2014 -0400
+++ b/src/share/vm/utilities/stack.hpp	Tue Apr 14 11:40:13 2015 +0200
@@ -96,11 +96,16 @@
 public:
   friend class StackIterator<E, F>;
 
+  // Number of elements that fit in 4K bytes minus the size of two pointers
+  // (link field and malloc header).
+  static const size_t _default_segment_size =  (4096 - 2 * sizeof(E*)) / sizeof(E);
+  static size_t default_segment_size() { return _default_segment_size; }
+
   // segment_size:    number of items per segment
   // max_cache_size:  maxmium number of *segments* to cache
   // max_size:        maximum number of items allowed, rounded to a multiple of
   //                  the segment size (0 == unlimited)
-  inline Stack(size_t segment_size = default_segment_size(),
+  inline Stack(size_t segment_size = _default_segment_size,
                size_t max_cache_size = 4, size_t max_size = 0);
   inline ~Stack() { clear(true); }
 
@@ -122,8 +127,6 @@
   // clear_cache is true, also release any cached segments.
   void clear(bool clear_cache = false);
 
-  static inline size_t default_segment_size();
-
 protected:
   // Each segment includes space for _seg_size elements followed by a link
   // (pointer) to the previous segment; the space is allocated as a single block
--- a/src/share/vm/utilities/stack.inline.hpp	Tue Jul 08 13:52:29 2014 -0400
+++ b/src/share/vm/utilities/stack.inline.hpp	Tue Apr 14 11:40:13 2015 +0200
@@ -86,14 +86,6 @@
 }
 
 template <class E, MEMFLAGS F>
-size_t Stack<E, F>::default_segment_size()
-{
-  // Number of elements that fit in 4K bytes minus the size of two pointers
-  // (link field and malloc header).
-  return (4096 - 2 * sizeof(E*)) / sizeof(E);
-}
-
-template <class E, MEMFLAGS F>
 size_t Stack<E, F>::adjust_segment_size(size_t seg_size)
 {
   const size_t elem_sz = sizeof(E);