01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17:
18: package org.apache.harmony.luni.platform;
19:
20: /**
21: * This is the interface that the memory watchers implement -- what they do with
22: * this information is largely undefined.
23: *
24: */
25: public interface IMemorySpy {
26:
27: public void alloc(PlatformAddress address);
28:
29: // Has a veto: true == do free,false = don't
30: public boolean free(PlatformAddress address);
31:
32: public void rangeCheck(PlatformAddress address, int offset,
33: int length) throws IndexOutOfBoundsException;
34:
35: /**
36: * Requests that the given address is freed automatically when it becomes
37: * garbage. If the address is alredy freed, or has not been notified as
38: * allocated via this memory spy, then this call has no effect and completes
39: * quietly.
40: *
41: * @param address
42: * the address to be freed.
43: */
44: public void autoFree(PlatformAddress address);
45: }
|