Skip to content

rename MemoryError -> OutOfMemoryError #10503

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 15, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion base/base.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ call(T::Type{DivideError}) = Core.call(T)
call(T::Type{DomainError}) = Core.call(T)
call(T::Type{OverflowError}) = Core.call(T)
call(T::Type{InexactError}) = Core.call(T)
call(T::Type{MemoryError}) = Core.call(T)
call(T::Type{OutOfMemoryError}) = Core.call(T)
call(T::Type{StackOverflowError}) = Core.call(T)
call(T::Type{UndefRefError}) = Core.call(T)
call(T::Type{UndefVarError}, var::Symbol) = Core.call(T, var)
Expand Down
4 changes: 2 additions & 2 deletions base/boot.jl
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ export
Char, ASCIIString, ByteString, DirectIndexString, AbstractString, UTF8String,
# errors
BoundsError, DivideError, DomainError, Exception,
InexactError, InterruptException, MemoryError, OverflowError,
InexactError, InterruptException, OutOfMemoryError, OverflowError,
StackOverflowError, UndefRefError, UndefVarError,
# AST representation
Expr, GotoNode, LabelNode, LineNumberNode, QuoteNode, SymbolNode, TopNode,
Expand Down Expand Up @@ -215,7 +215,7 @@ immutable DivideError <: Exception end
immutable DomainError <: Exception end
immutable OverflowError <: Exception end
immutable InexactError <: Exception end
immutable MemoryError <: Exception end
immutable OutOfMemoryError <: Exception end
immutable StackOverflowError <: Exception end
immutable UndefRefError <: Exception end
immutable UndefVarError <: Exception
Expand Down
3 changes: 3 additions & 0 deletions base/deprecated.jl
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,9 @@ const base64 = base64encode
@deprecate error(ex::Exception) throw(ex)
@deprecate error{E<:Exception}(::Type{E}) throw(E())

export MemoryError
const MemoryError = OutOfMemoryError

@deprecate map!(f::Callable, dest::StridedArray, A::StridedArray, B::Number) broadcast!(f, dest, A, B)
@deprecate map!(f::Callable, dest::StridedArray, A::Number, B::StridedArray) broadcast!(f, dest, A, B)

Expand Down
2 changes: 1 addition & 1 deletion base/sparse/umfpack.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function umferror(status::Integer)
elseif status==UMFPACK_WARNING_determinant_overflow
throw(MatrixIllConditionedException("The determinant overflowed"))
elseif status==UMFPACK_ERROR_out_of_memory
throw(MemoryError())
throw(OutOfMemoryError())
elseif status==UMFPACK_ERROR_invalid_Numeric_object
throw(ArgumentError("Invalid UMFPack numeric object"))
elseif status==UMFPACK_ERROR_invalid_Symbolic_object
Expand Down
2 changes: 1 addition & 1 deletion doc/manual/control-flow.rst
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ built-in :exc:`Exception`\ s listed below all interrupt the normal flow of contr
+---------------------------+
| :exc:`LoadError` |
+---------------------------+
| :exc:`MemoryError` |
| :exc:`OutOfMemoryError` |
+---------------------------+
| :exc:`MethodError` |
+---------------------------+
Expand Down
2 changes: 1 addition & 1 deletion src/ast.c
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ static value_t julia_to_scm(jl_value_t *v)
static void array_to_list(jl_array_t *a, value_t *pv)
{
if (jl_array_len(a) > 300000)
lerror(MemoryError, "expression too large");
lerror(OutOfMemoryError, "expression too large");
value_t temp;
for(long i=jl_array_len(a)-1; i >= 0; i--) {
*pv = fl_cons(FL_NIL, *pv);
Expand Down
2 changes: 1 addition & 1 deletion src/flisp/cvalues.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ void add_finalizer(cvalue_t *cv)
size_t nn = (maxfinalizers==0 ? 256 : maxfinalizers*2);
cvalue_t **temp = (cvalue_t**)realloc(Finalizers, nn*sizeof(value_t));
if (temp == NULL)
lerror(MemoryError, "out of memory");
lerror(OutOfMemoryError, "out of memory");
Finalizers = temp;
maxfinalizers = nn;
}
Expand Down
10 changes: 5 additions & 5 deletions src/flisp/flisp.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ static value_t *GCHandleStack[N_GC_HANDLES];
static uint32_t N_GCHND = 0;

value_t FL_NIL, FL_T, FL_F, FL_EOF, QUOTE;
value_t IOError, ParseError, TypeError, ArgError, UnboundError, MemoryError;
value_t IOError, ParseError, TypeError, ArgError, UnboundError, OutOfMemoryError;
value_t DivideError, BoundsError, Error, KeyError, EnumerationError;
value_t printwidthsym, printreadablysym, printprettysym, printlengthsym;
value_t printlevelsym, builtins_table_sym;
Expand Down Expand Up @@ -465,7 +465,7 @@ static inline int symchar(char c);
void fl_gc_handle(value_t *pv)
{
if (N_GCHND >= N_GC_HANDLES)
lerror(MemoryError, "out of gc handles");
lerror(OutOfMemoryError, "out of gc handles");
GCHandleStack[N_GCHND++] = pv;
}

Expand Down Expand Up @@ -705,7 +705,7 @@ static void grow_stack(void)
size_t newsz = N_STACK + (N_STACK>>1);
value_t *ns = (value_t*)realloc(Stack, newsz*sizeof(value_t));
if (ns == NULL)
lerror(MemoryError, "stack overflow");
lerror(OutOfMemoryError, "stack overflow");
Stack = ns;
N_STACK = newsz;
}
Expand Down Expand Up @@ -2364,7 +2364,7 @@ static void lisp_init(size_t initial_heapsize)
IOError = symbol("io-error"); ParseError = symbol("parse-error");
TypeError = symbol("type-error"); ArgError = symbol("arg-error");
UnboundError = symbol("unbound-error");
KeyError = symbol("key-error"); MemoryError = symbol("memory-error");
KeyError = symbol("key-error"); OutOfMemoryError = symbol("memory-error");
BoundsError = symbol("bounds-error");
DivideError = symbol("divide-error");
EnumerationError = symbol("enumeration-error");
Expand Down Expand Up @@ -2420,7 +2420,7 @@ static void lisp_init(size_t initial_heapsize)
setc(symbol("*install-dir*"), cvalue_static_cstring(strdup(dirname(exename))));
}

memory_exception_value = fl_list2(MemoryError,
memory_exception_value = fl_list2(OutOfMemoryError,
cvalue_static_cstring("out of memory"));

assign_global_builtins(core_builtin_info);
Expand Down
2 changes: 1 addition & 1 deletion src/flisp/flisp.h
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ void bounds_error(char *fname, value_t arr, value_t ind) __attribute__ ((__noret
void fl_savestate(fl_exception_context_t *_ctx);
void fl_restorestate(fl_exception_context_t *_ctx);

extern value_t ArgError, IOError, KeyError, MemoryError, EnumerationError;
extern value_t ArgError, IOError, KeyError, OutOfMemoryError, EnumerationError;
extern value_t UnboundError;

static inline void argcount(char *fname, uint32_t nargs, uint32_t c)
Expand Down
2 changes: 1 addition & 1 deletion src/flisp/iostream.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ value_t fl_buffer(value_t *args, u_int32_t nargs)
value_t f = cvalue(iostreamtype, sizeof(ios_t));
ios_t *s = value2c(ios_t*, f);
if (ios_mem(s, 0) == NULL)
lerror(MemoryError, "buffer: could not allocate stream");
lerror(OutOfMemoryError, "buffer: could not allocate stream");
return f;
}

Expand Down
2 changes: 1 addition & 1 deletion src/flisp/julia_extensions.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ static char *normalize(char *s)
if (newlen > buflen) {
buflen = newlen * 2;
buf = realloc(buf, buflen);
if (!buf) lerror(MemoryError, "error allocating UTF8 buffer");
if (!buf) lerror(OutOfMemoryError, "error allocating UTF8 buffer");
}
result = utf8proc_decompose((uint8_t*)s,0, (int32_t*)buf,result, options);
if (result < 0) goto error;
Expand Down
2 changes: 1 addition & 1 deletion src/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -1262,7 +1262,7 @@ void jl_get_builtin_hooks(void)
jl_undefvarerror_type = (jl_datatype_t*)core("UndefVarError");
jl_interrupt_exception = jl_new_struct_uninit((jl_datatype_t*)core("InterruptException"));
jl_boundserror_type = (jl_datatype_t*)core("BoundsError");
jl_memory_exception = jl_new_struct_uninit((jl_datatype_t*)core("MemoryError"));
jl_memory_exception = jl_new_struct_uninit((jl_datatype_t*)core("OutOfMemoryError"));

jl_ascii_string_type = (jl_datatype_t*)core("ASCIIString");
jl_utf8_string_type = (jl_datatype_t*)core("UTF8String");
Expand Down