pike.git/
src/
error.c
Branch:
Tag:
Non-build tags
All tags
No tags
2018-02-19
2018-02-19 17:54:08 by Martin Nilsson <nilsson@fastmail.com>
8df9eb3b0f80743b9588d28a50abc7823aed9a7f (
19
lines) (+
10
/-
9
)
[
Show
|
Annotate
]
Branch:
master
Remove resource_error as public function.
1066:
} /* coverity[+kill] */
-
PMOD_EXPORT
DECLSPEC(noreturn) void resource_error(
-
const char *func,
-
const struct svalue *base_sp,
int args,
-
const char *resource_type,
+
static
DECLSPEC(noreturn) void resource_error(
+
const char *func, int args,
size_t howmuch_, const char *desc, ...) ATTRIBUTE((noreturn)) { INT_TYPE howmuch = (INT_TYPE)howmuch_;
-
+
const struct svalue *base_sp = NULL;
INIT_ERROR(resource);
-
+
if(args>=0) base_sp = Pike_sp-args;
ERROR_COPY(resource, howmuch);
-
ERROR_STRUCT(resource,o)->resource_type=make_shared_string(
resource_type
);
+
ERROR_STRUCT(resource,o)->resource_type=make_shared_string(
"memory"
);
ERROR_DONE(generic); } PMOD_EXPORT DECLSPEC(noreturn) void out_of_memory_error (
-
const char *func,
-
const struct svalue *base_sp,
int args,
+
const char *func, int args,
size_t amount) {
-
resource_error (func,
base_sp,
args,
"memory",
amount,
+
resource_error (func, args, amount,
amount ? msg_out_of_mem_2 : msg_out_of_mem, amount);
-
+
UNREACHABLE();
} /* coverity[+kill] */