/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "defines.h"
#include "bytes.h"
#include "utils.h"
}
// set ptr to some victim memory, to ease escape
}
}
return;
}
} else {
}
}
}
len = 0;
ptr = 0;
}
return (p == 0) ? -1 : (int)(p - ptr);
}
}
}
// Save as much as possible. (Helps unpacker::abort.)
}
}
//#TODO: Need to fix for exception handling
}
#ifndef PRODUCT
if (len == 0) return "";
}
#endif
// Make sure there are 'o' bytes beyond the fill pointer,
// advance the fill pointer, and return the old fill pointer.
return limit()-s;
}
if (allocated == 0) {
// Initial buffer was not malloced. Do not reallocate it.
} else {
}
return dummy; // scribble during error recov.
}
// after realloc, recompute pointers
return limit()-s;
}
if (allocated >= s) return;
}
for (int i = 0; i < len; i++) {
if (get(i) == x) return i;
}
return -1;
}
for (int i = 0; i < len; i++) {
void* p = (void*) get(i);
if (p != null) {
mtrace('f', p, 0);
::free(p);
}
}
free();
}
for (int i = 0; i < len; i++) {
if (get(i) == x) return i;
}
return -1;
}