Jinoh Kang (@iamahuman) commented about server/mapping.c:
- return 0;
+}
+int alloc_shared_object(void) +{
- int index;
- for (index = 0; index < session.object_count; index++)
if (!session.shared->objects[index].obj.id)
break;
- if (index == session.object_count)
- {
if (session.object_count == session.object_capacity && grow_session_mapping()) return -1;
index = session.object_count++;
- }
Not a blocker, but wouldn't it be faster if we didn't scan empty slots before we actually run out of capacity?