@Override
	public int getLocalSize() {
		function.manager.lock.acquire();
		try {
			checkIsValid();

			int baseOffset = 0;
			Integer base = VariableUtilities.getBaseStackParamOffset(function);
			if (base != null) {
				baseOffset = (int) base.longValue();
			}

			// Negative growth
			if (stackGrowsNegative) {
				if (variables.length != 0 && !(variables[0] instanceof Parameter)) {
					int offset = (int) variables[0].getLastStorageVarnode().getOffset();
					if (offset > 0) {
						offset = 0;
					}
					return baseOffset - offset;
				}
				return baseOffset;
			}

			// Positive growth
			int index = variables.length - 1;
			if (index < 0) {
				return -baseOffset;
			}
			if (!(variables[index] instanceof Parameter)) {
				Varnode stackVarnode = variables[index].getLastStorageVarnode();
				int len = stackVarnode.getSize();
				int offset = (int) stackVarnode.getOffset();
				if (offset < 0) {
					offset = 0;
				}
				return offset - baseOffset + len;
			}
			return -baseOffset;
		}
		finally {
			function.manager.lock.release();
		}
	}
Construct a function stack frame.
@param function
@param variables
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/function/FunctionStackFrame.java