Merge pull request #51789 from AndreaCatania/improve-mess-queu-failing
Improve error reporting when the Message Queue is out of Memory.
This commit is contained in:
commit
fd9f4d340b
1 changed files with 6 additions and 6 deletions
|
@ -55,9 +55,9 @@ Error MessageQueue::push_set(ObjectID p_id, const StringName &p_prop, const Vari
|
||||||
if (ObjectDB::get_instance(p_id)) {
|
if (ObjectDB::get_instance(p_id)) {
|
||||||
type = ObjectDB::get_instance(p_id)->get_class();
|
type = ObjectDB::get_instance(p_id)->get_class();
|
||||||
}
|
}
|
||||||
print_line("Failed set: " + type + ":" + p_prop + " target ID: " + itos(p_id));
|
ERR_PRINT("Failed set: " + type + ":" + p_prop + " target ID: " + itos(p_id) + ". Message queue out of memory. Try increasing 'memory/limits/message_queue/max_size_kb' in project settings.");
|
||||||
statistics();
|
statistics();
|
||||||
ERR_FAIL_V_MSG(ERR_OUT_OF_MEMORY, "Message queue out of memory. Try increasing 'memory/limits/message_queue/max_size_kb' in project settings.");
|
return ERR_OUT_OF_MEMORY;
|
||||||
}
|
}
|
||||||
|
|
||||||
Message *msg = memnew_placement(&buffer[buffer_end], Message);
|
Message *msg = memnew_placement(&buffer[buffer_end], Message);
|
||||||
|
@ -82,9 +82,9 @@ Error MessageQueue::push_notification(ObjectID p_id, int p_notification) {
|
||||||
uint8_t room_needed = sizeof(Message);
|
uint8_t room_needed = sizeof(Message);
|
||||||
|
|
||||||
if ((buffer_end + room_needed) >= buffer_size) {
|
if ((buffer_end + room_needed) >= buffer_size) {
|
||||||
print_line("Failed notification: " + itos(p_notification) + " target ID: " + itos(p_id));
|
ERR_PRINT("Failed notification: " + itos(p_notification) + " target ID: " + itos(p_id) + ". Message queue out of memory. Try increasing 'memory/limits/message_queue/max_size_kb' in project settings.");
|
||||||
statistics();
|
statistics();
|
||||||
ERR_FAIL_V_MSG(ERR_OUT_OF_MEMORY, "Message queue out of memory. Try increasing 'memory/limits/message_queue/max_size_kb' in project settings.");
|
return ERR_OUT_OF_MEMORY;
|
||||||
}
|
}
|
||||||
|
|
||||||
Message *msg = memnew_placement(&buffer[buffer_end], Message);
|
Message *msg = memnew_placement(&buffer[buffer_end], Message);
|
||||||
|
@ -117,9 +117,9 @@ Error MessageQueue::push_callablep(const Callable &p_callable, const Variant **p
|
||||||
int room_needed = sizeof(Message) + sizeof(Variant) * p_argcount;
|
int room_needed = sizeof(Message) + sizeof(Variant) * p_argcount;
|
||||||
|
|
||||||
if ((buffer_end + room_needed) >= buffer_size) {
|
if ((buffer_end + room_needed) >= buffer_size) {
|
||||||
print_line("Failed method: " + p_callable);
|
ERR_PRINT("Failed method: " + p_callable + ". Message queue out of memory. Try increasing 'memory/limits/message_queue/max_size_kb' in project settings.");
|
||||||
statistics();
|
statistics();
|
||||||
ERR_FAIL_V_MSG(ERR_OUT_OF_MEMORY, "Message queue out of memory. Try increasing 'memory/limits/message_queue/max_size_kb' in project settings.");
|
return ERR_OUT_OF_MEMORY;
|
||||||
}
|
}
|
||||||
|
|
||||||
Message *msg = memnew_placement(&buffer[buffer_end], Message);
|
Message *msg = memnew_placement(&buffer[buffer_end], Message);
|
||||||
|
|
Loading…
Reference in a new issue