1 // Copyright 2021 Code Intelligence GmbH 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 package com.code_intelligence.jazzer.runtime; 16 17 import java.nio.ByteBuffer; 18 19 /** 20 * Represents the Java view on a libFuzzer 8 bit counter coverage map. 21 * By using a direct ByteBuffer, the counter array is shared directly with 22 * native code. 23 */ 24 final public class CoverageMap { 25 public static ByteBuffer mem = ByteBuffer.allocateDirect(0); 26 enlargeCoverageMap()27 public static void enlargeCoverageMap() { 28 registerNewCoverageCounters(); 29 System.out.println("INFO: New number of inline 8-bit counters: " + mem.capacity()); 30 } 31 registerNewCoverageCounters()32 private static native void registerNewCoverageCounters(); 33 } 34