• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

polserver / polserver / 13484236498

23 Feb 2025 03:06PM UTC coverage: 58.838% (+0.06%) from 58.783%
13484236498

push

github

web-flow
Modulus operations with doubles (#769)

* implemented modulus operator % and %= for doubles
int%dbl=dbl
dbl%int=dbl
dbl%dbl=dbl
...

* added missing test for ins_set_member_id_consume_divideequal

* more tests
docs

26 of 26 new or added lines in 2 files covered. (100.0%)

10 existing lines in 3 files now uncovered.

42342 of 71964 relevant lines covered (58.84%)

385815.91 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

85.42
/pol-core/pol/globals/object_storage.cpp
1
#include "object_storage.h"
2

3
#include <string.h>
4

5
#include "../../clib/stlutil.h"
6
#include "../objecthash.h"
7
#include "../reftypes.h"
8
#include "../uobject.h"
9

10
namespace Pol
11
{
12
namespace Core
13
{
14
ObjectStorageManager objStorageManager;
15

16
ObjectStorageManager::ObjectStorageManager()
3✔
17
    : deferred_insertions(),
3✔
18
      modified_serials(),
3✔
19
      deleted_serials(),
3✔
20
      clean_objects( 0 ),
3✔
21
      dirty_objects( 0 ),
3✔
22
      objecthash()
3✔
23
{
24
}
3✔
25

26
ObjectStorageManager::~ObjectStorageManager() {}
3✔
27

28

29
void ObjectStorageManager::deinitialize()
3✔
30
{
31
  objecthash.Clear();
3✔
32
  deferred_insertions.clear();
3✔
33
  modified_serials.clear();
3✔
34
  deleted_serials.clear();
3✔
35
}
3✔
36

37
ObjectStorageManager::MemoryUsage ObjectStorageManager::estimateSize() const
1✔
38
{
39
  ObjectHash::OH_const_iterator hs_citr = objStorageManager.objecthash.begin(),
1✔
40
                                hs_cend = objStorageManager.objecthash.end();
1✔
41

42
  MemoryUsage usage;
43
  memset( &usage, 0, sizeof( usage ) );
1✔
44

45
  usage.objcount = std::distance( hs_citr, hs_cend );
1✔
46
  for ( ; hs_citr != hs_cend; ++hs_citr )
40✔
47
  {
48
    const UObjectRef& ref = ( *hs_citr ).second;
39✔
49
    auto size = ref->estimatedSize();
39✔
50
    usage.objsize += size;
39✔
51
    if ( ref->isa( UOBJ_CLASS::CLASS_ITEM ) )
39✔
52
    {
53
      usage.obj_item_size += size;
20✔
54
      usage.obj_item_count++;
20✔
55
    }
56
    else if ( ref->isa( UOBJ_CLASS::CLASS_CONTAINER ) )
19✔
57
    {
58
      usage.obj_cont_size += size;
7✔
59
      usage.obj_cont_count++;
7✔
60
    }
61
    else if ( ref->isa( UOBJ_CLASS::CLASS_CHARACTER ) )
12✔
62
    {
63
      usage.obj_char_size += size;
×
64
      usage.obj_char_count++;
×
65
    }
66
    else if ( ref->isa( UOBJ_CLASS::CLASS_NPC ) )
12✔
67
    {
68
      usage.obj_npc_size += size;
×
69
      usage.obj_npc_count++;
×
70
    }
71
    else if ( ref->isa( UOBJ_CLASS::CLASS_WEAPON ) )
12✔
72
    {
73
      usage.obj_weapon_size += size;
11✔
74
      usage.obj_weapon_count++;
11✔
75
    }
76
    else if ( ref->isa( UOBJ_CLASS::CLASS_ARMOR ) )
1✔
77
    {
78
      usage.obj_armor_size += size;
1✔
79
      usage.obj_armor_count++;
1✔
80
    }
UNCOV
81
    else if ( ref->isa( UOBJ_CLASS::CLASS_MULTI ) )
×
82
    {
UNCOV
83
      usage.obj_multi_size += size;
×
UNCOV
84
      usage.obj_multi_count++;
×
85
    }
86
  }
87

88
  usage.misc = objecthash.estimateSize() + Clib::memsize( modified_serials ) +
1✔
89
               Clib::memsize( deleted_serials ) + Clib::memsize( deferred_insertions );
1✔
90

91
  return usage;
2✔
92
}
93
}  // namespace Core
94
}  // namespace Pol
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc