mirror of
https://github.com/openjdk/jdk.git
synced 2026-04-21 12:20:29 +00:00
8382391: Cleanup unnecessary storestore() in stringStream::as_string
Reviewed-by: stefank, dlong, shade
This commit is contained in:
parent
35b0de3d4d
commit
8d79d4794e
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -425,11 +425,6 @@ char* stringStream::as_string(bool c_heap) const {
|
||||
NEW_C_HEAP_ARRAY(char, _written + 1, mtInternal) : NEW_RESOURCE_ARRAY(char, _written + 1);
|
||||
::memcpy(copy, _buffer, _written);
|
||||
copy[_written] = '\0'; // terminating null
|
||||
if (c_heap) {
|
||||
// Need to ensure our content is written to memory before we return
|
||||
// the pointer to it.
|
||||
OrderAccess::storestore();
|
||||
}
|
||||
return copy;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user