Forums WoW Modding Support Archives Azerothcore Discord Archives [DiscordArchive] why is there a thread handling mail expirations?

[DiscordArchive] why is there a thread handling mail expirations?

[DiscordArchive] why is there a thread handling mail expirations?

Pages (4): Previous 1 2 3 4
rektbyfaith
Administrator
0
11-11-2024, 12:21 PM
#31
Archived author: andriuspel • Posted: 2024-11-11T12:21:53.621000+00:00
Original source

unless for cases where i need to intentionally delete item and effect original
rektbyfaith
11-11-2024, 12:21 PM #31

Archived author: andriuspel • Posted: 2024-11-11T12:21:53.621000+00:00
Original source

unless for cases where i need to intentionally delete item and effect original

rektbyfaith
Administrator
0
11-11-2024, 12:23 PM
#32
Archived author: andriuspel • Posted: 2024-11-11T12:23:21.245000+00:00
Original source

```c
auto& item = items.at(0):
item.reset(); // passing null also works

// or just
items.at(0).reset();
``` in this example I would deallocate main container, but rest references still gonna be alive till their code algorythm end
rektbyfaith
11-11-2024, 12:23 PM #32

Archived author: andriuspel • Posted: 2024-11-11T12:23:21.245000+00:00
Original source

```c
auto& item = items.at(0):
item.reset(); // passing null also works

// or just
items.at(0).reset();
``` in this example I would deallocate main container, but rest references still gonna be alive till their code algorythm end

rektbyfaith
Administrator
0
11-11-2024, 12:25 PM
#33
Archived author: andriuspel • Posted: 2024-11-11T12:25:42.964000+00:00
Original source

at base my plan is - for most calls to ensure that extra shared_ptr reference is created to ensure pointer lifetime
rektbyfaith
11-11-2024, 12:25 PM #33

Archived author: andriuspel • Posted: 2024-11-11T12:25:42.964000+00:00
Original source

at base my plan is - for most calls to ensure that extra shared_ptr reference is created to ensure pointer lifetime

rektbyfaith
Administrator
0
11-11-2024, 12:26 PM
#34
Archived author: andriuspel • Posted: 2024-11-11T12:26:43.762000+00:00
Original source

these references will not leak or increase memory usage (except atomic counter, which by default is size_t in shared_ptr, may will increment/decrement)
rektbyfaith
11-11-2024, 12:26 PM #34

Archived author: andriuspel • Posted: 2024-11-11T12:26:43.762000+00:00
Original source

these references will not leak or increase memory usage (except atomic counter, which by default is size_t in shared_ptr, may will increment/decrement)

rektbyfaith
Administrator
0
11-11-2024, 12:33 PM
#35
Archived author: walkline • Posted: 2024-11-11T12:33:40.413000+00:00
Original source

Looks to me like a good change
rektbyfaith
11-11-2024, 12:33 PM #35

Archived author: walkline • Posted: 2024-11-11T12:33:40.413000+00:00
Original source

Looks to me like a good change

rektbyfaith
Administrator
0
11-11-2024, 12:36 PM
#36
Archived author: andriuspel • Posted: 2024-11-11T12:36:45.978000+00:00
Original source

i will make same change for trinitycore too Smile but anyways this pr review will take a lot of time... Big Grin but well, i'm not in hurry Smile unless more laravel work will appear xD
rektbyfaith
11-11-2024, 12:36 PM #36

Archived author: andriuspel • Posted: 2024-11-11T12:36:45.978000+00:00
Original source

i will make same change for trinitycore too Smile but anyways this pr review will take a lot of time... Big Grin but well, i'm not in hurry Smile unless more laravel work will appear xD

rektbyfaith
Administrator
0
11-11-2024, 02:08 PM
#37
Archived author: andriuspel • Posted: 2024-11-11T14:08:24.407000+00:00
Original source

minor example, in this example i made extra reference (increments shared_ptr counter),
old: ```c
for (uint8 i = 0; i < EQUIPMENT_SLOT_END; ++i)
{
if (!m_items[i])
continue;

m_items[i]->BuildCreateUpdateBlockForPlayer(data, target);
}``` new: ```c
for (uint8 i = 0; i < EQUIPMENT_SLOT_END; ++i)
{
if (std:Confusedhared_ptr<Item> item = m_myItems[i])
item->BuildCreateUpdateBlockForPlayer(data, target);
}```
rektbyfaith
11-11-2024, 02:08 PM #37

Archived author: andriuspel • Posted: 2024-11-11T14:08:24.407000+00:00
Original source

minor example, in this example i made extra reference (increments shared_ptr counter),
old: ```c
for (uint8 i = 0; i < EQUIPMENT_SLOT_END; ++i)
{
if (!m_items[i])
continue;

m_items[i]->BuildCreateUpdateBlockForPlayer(data, target);
}``` new: ```c
for (uint8 i = 0; i < EQUIPMENT_SLOT_END; ++i)
{
if (std:Confusedhared_ptr<Item> item = m_myItems[i])
item->BuildCreateUpdateBlockForPlayer(data, target);
}```

rektbyfaith
Administrator
0
11-11-2024, 02:09 PM
#38
Archived author: andriuspel • Posted: 2024-11-11T14:09:41.744000+00:00
Original source

```c
for (uint8 i = 0; i < INVENTORY_SLOT_BAG_END; ++i)
{
auto item = m_myItems[i];
if (item == nullptr)
{
continue;
}

ItemTemplate const* proto = item->GetTemplate();
if (proto == nullptr)
continue;

// item set bonuses not dependent from item broken state
if (proto->ItemSet)
RemoveItemsSetItem(this, proto);

if (item->IsBroken() || !CanUseAttackType(GetAttackBySlot(i)))
continue;

ApplyItemEquipSpell(item.get(), false);
ApplyEnchantment(item.get(), false);
}```
rektbyfaith
11-11-2024, 02:09 PM #38

Archived author: andriuspel • Posted: 2024-11-11T14:09:41.744000+00:00
Original source

```c
for (uint8 i = 0; i < INVENTORY_SLOT_BAG_END; ++i)
{
auto item = m_myItems[i];
if (item == nullptr)
{
continue;
}

ItemTemplate const* proto = item->GetTemplate();
if (proto == nullptr)
continue;

// item set bonuses not dependent from item broken state
if (proto->ItemSet)
RemoveItemsSetItem(this, proto);

if (item->IsBroken() || !CanUseAttackType(GetAttackBySlot(i)))
continue;

ApplyItemEquipSpell(item.get(), false);
ApplyEnchantment(item.get(), false);
}```

rektbyfaith
Administrator
0
11-11-2024, 02:11 PM
#39
Archived author: andriuspel • Posted: 2024-11-11T14:11:08.811000+00:00
Original source

so if m_myItems[i] object is removed, referenced references still gonna be valid till code end
rektbyfaith
11-11-2024, 02:11 PM #39

Archived author: andriuspel • Posted: 2024-11-11T14:11:08.811000+00:00
Original source

so if m_myItems[i] object is removed, referenced references still gonna be valid till code end

Pages (4): Previous 1 2 3 4
Recently Browsing
 
Recently Browsing