Skip to content
Snippets Groups Projects
Commit 9b3a9bb1 authored by Mick Jordan's avatar Mick Jordan
Browse files

change default FunctionUID to atmic long

parent 74c56c40
Branches
No related tags found
No related merge requests found
/*
* Copyright (c) 2015, 2015, 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* 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.
*/
package com.oracle.truffle.r.nodes.function;
import java.util.concurrent.atomic.*;
public class ALONGFunctionUIDFactory extends FunctionUIDFactory {
private static final AtomicLong ID = new AtomicLong();
private static final class ALongFunctionUID implements FunctionUID {
private final long uuid;
private ALongFunctionUID(long uuid) {
this.uuid = uuid;
}
@Override
public int compareTo(FunctionUID o) {
ALongFunctionUID oa = (ALongFunctionUID) o;
if (uuid == oa.uuid) {
return 0;
} else if (uuid < oa.uuid) {
return -1;
} else {
return 1;
}
}
@Override
public String toString() {
return Long.toString(uuid);
}
}
@Override
public FunctionUID createUID() {
return new ALongFunctionUID(ID.incrementAndGet());
}
}
/*
* Copyright (c) 2014, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2015, 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
......@@ -28,7 +28,7 @@ public abstract class FunctionUIDFactory {
private static final String FACTORY_CLASS_PROPERTY = "fastr.fuid.factory.class";
private static final String PACKAGE_PREFIX = "com.oracle.truffle.r.nodes.function.";
private static final String SUFFIX = "FunctionUIDFactory";
private static final String DEFAULT_FACTORY = "uuid";
private static final String DEFAULT_FACTORY = "along";
private static final String DEFAULT_FACTORY_CLASS = mapSimpleName(DEFAULT_FACTORY);
private static String mapSimpleName(String simpleName) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment