2626
2727import java .util .EnumSet ;
2828
29- import com .oracle .svm .core .util .VMError ;
3029import org .graalvm .compiler .api .replacements .Fold ;
3130import org .graalvm .nativeimage .ImageSingletons ;
3231import org .graalvm .nativeimage .c .type .WordPointer ;
@@ -90,22 +89,6 @@ default UnsignedWord getGranularity() {
9089 return VirtualMemoryProvider .get ().getGranularity ();
9190 }
9291
93- /**
94- * Allocate a block of committed memory.
95- *
96- * @param nbytes The number of bytes to allocate, which is rounded up to the next multiple of
97- * the {@linkplain #getGranularity() granularity} if required.
98- * @param alignment The required alignment of the block start, or {@link #UNALIGNED}.
99- * @param executable Whether the block must be executable.
100- * @return The start of the allocated block, or {@link WordFactory#nullPointer()} in case of an
101- * error.
102- */
103- default Pointer allocate (UnsignedWord nbytes , UnsignedWord alignment , boolean executable ) {
104- // We need this default method temporarily so that we can remove the methods allocate and
105- // free from all subclasses in GR-34236.
106- throw VMError .shouldNotReachHere ("Subclasses must overwrite this method" );
107- }
108-
10992 Pointer allocateAlignedChunk (UnsignedWord nbytes , UnsignedWord alignment );
11093
11194 Pointer allocateUnalignedChunk (UnsignedWord nbytes );
@@ -118,23 +101,6 @@ default Pointer allocate(UnsignedWord nbytes, UnsignedWord alignment, boolean ex
118101 */
119102 boolean areUnalignedChunksZeroed ();
120103
121- /**
122- * Release a block of committed memory that was allocated with {@link #allocate}, requiring the
123- * exact same parameter values that were originally passed to {@link #allocate}.
124- *
125- * @param start The start of the memory block, as returned by {@link #allocate}.
126- * @param nbytes The originally requested size in bytes.
127- * @param alignment The originally requested alignment.
128- * @param executable Whether the block was requested to be executable.
129- * @return true on success, or false otherwise.
130- */
131- @ Uninterruptible (reason = "Called from uninterruptible code." , mayBeInlined = true )
132- default boolean free (PointerBase start , UnsignedWord nbytes , UnsignedWord alignment , boolean executable ) {
133- // We need this default method temporarily so that we can remove the methods allocate and
134- // free from all subclasses in GR-34236.
135- throw VMError .shouldNotReachHere ("Subclasses must overwrite this method" );
136- }
137-
138104 @ Uninterruptible (reason = "Called from uninterruptible code." , mayBeInlined = true )
139105 void freeAlignedChunk (PointerBase start , UnsignedWord nbytes , UnsignedWord alignment );
140106
@@ -165,8 +131,8 @@ enum Access {
165131 }
166132
167133 /**
168- * Change access permissions for a block of committed memory that was allocated with
169- * {@link #allocate} .
134+ * Change access permissions for a block of committed memory that was allocated with one of the
135+ * allocation methods .
170136 *
171137 * @param start The start of the address range to be protected, which must be a multiple of the
172138 * {@linkplain #getGranularity() granularity}.
0 commit comments