< prev index next >

src/hotspot/share/jfr/recorder/storage/jfrBuffer.cpp

Print this page




   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "jfr/recorder/storage/jfrBuffer.hpp"
  27 #include "runtime/atomic.hpp"
  28 #include "runtime/orderAccess.inline.hpp"
  29 #include "runtime/thread.inline.hpp"
  30 
  31 static const u1* const MUTEX_CLAIM = NULL;
  32 
  33 JfrBuffer::JfrBuffer() : _next(NULL),
  34                          _prev(NULL),
  35                          _identity(NULL),
  36                          _pos(NULL),
  37                          _top(NULL),
  38                          _flags(0),
  39                          _header_size(0),
  40                          _size(0) {}
  41 
  42 bool JfrBuffer::initialize(size_t header_size, size_t size, const void* id /* NULL */) {
  43   _header_size = (u2)header_size;
  44   _size = (u4)(size / BytesPerWord);
  45   assert(_identity == NULL, "invariant");
  46   _identity = id;
  47   set_pos(start());
  48   set_top(start());




   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "jfr/recorder/storage/jfrBuffer.hpp"
  27 #include "runtime/atomic.hpp"
  28 #include "runtime/orderAccess.hpp"
  29 #include "runtime/thread.inline.hpp"
  30 
  31 static const u1* const MUTEX_CLAIM = NULL;
  32 
  33 JfrBuffer::JfrBuffer() : _next(NULL),
  34                          _prev(NULL),
  35                          _identity(NULL),
  36                          _pos(NULL),
  37                          _top(NULL),
  38                          _flags(0),
  39                          _header_size(0),
  40                          _size(0) {}
  41 
  42 bool JfrBuffer::initialize(size_t header_size, size_t size, const void* id /* NULL */) {
  43   _header_size = (u2)header_size;
  44   _size = (u4)(size / BytesPerWord);
  45   assert(_identity == NULL, "invariant");
  46   _identity = id;
  47   set_pos(start());
  48   set_top(start());


< prev index next >