#include "src/surf/cpu_interface.hpp"
#include "src/surf/surf_routing.hpp"
-static XBT_INLINE void surf_cpu_free(void *r) {
- delete static_cast<simgrid::surf::Cpu*>(r);
-}
-static XBT_INLINE void routing_asr_host_free(void *p) {
- delete static_cast<simgrid::surf::RoutingEdge*>(p);
-}
-
void sg_host_init()
{
MSG_HOST_LEVEL = simgrid::Host::extension_create([](void *p) {
__MSG_host_priv_free((msg_host_priv_t) p);
});
+
+ ROUTING_HOST_LEVEL = simgrid::Host::extension_create([](void *p) {
+ delete static_cast<simgrid::surf::RoutingEdge*>(p);
+ });
+
SD_HOST_LEVEL = simgrid::Host::extension_create(__SD_workstation_destroy);
SIMIX_HOST_LEVEL = simgrid::Host::extension_create(SIMIX_host_destroy);
- simgrid::surf::Cpu::classInit();
- ROUTING_HOST_LEVEL = simgrid::Host::extension_create(routing_asr_host_free);
USER_HOST_LEVEL = simgrid::Host::extension_create(NULL);
+ simgrid::surf::Cpu::classInit();
}
// ========== User data Layer ==========
simgrid::surf::signal<void(simgrid::surf::Host*)> Host::onDestruction;
simgrid::surf::signal<void(simgrid::surf::Host*, e_surf_resource_state_t, e_surf_resource_state_t)> Host::onStateChange;
-static void host_destroy(void *h){
- static_cast<simgrid::surf::Host*>(h)->destroy();
-}
-
void Host::classInit()
{
if (!EXTENSION_ID.valid()) {
- EXTENSION_ID = simgrid::Host::extension_create<simgrid::surf::Host>(host_destroy);
+ EXTENSION_ID = simgrid::Host::extension_create<simgrid::surf::Host>([](void *h) {
+ static_cast<simgrid::surf::Host*>(h)->destroy();
+ });
SURF_HOST_LEVEL = EXTENSION_ID.id(); // FIXME: KILLME
}
}