Skip to content

Commit 34a60c8

Browse files
authored
Update modulemap.private and Data part (#148)
1 parent 7d9109b commit 34a60c8

File tree

28 files changed

+188
-76
lines changed

28 files changed

+188
-76
lines changed

Sources/OpenGraphCxx/Attribute/OGAttribute.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
#include <OpenGraph/OGAttribute.h>
66
#include <OpenGraphCxx/Attribute/AttributeID.hpp>
7-
#include <OpenGraphCxx/Util/assert.hpp>
7+
#include <OpenGraphCxx/Misc/assert.hpp>
88
#include <optional>
99

1010
const OGAttribute OGAttributeNil = OGAttribute(OG::AttributeID::Kind::Null);

Sources/OpenGraphCxx/Data/table.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
// table.cpp
33
// OpenGraphCxx
44
//
5-
// Audited for 6.5.4
5+
// Audited for 6.5.1
66
// Status: WIP
77
// Modified based Compute code
88

99
#include <OpenGraphCxx/Data/table.hpp>
1010
#include <OpenGraphCxx/Data/page.hpp>
1111
#include <OpenGraphCxx/Data/page_const.hpp>
1212
#include <OpenGraphCxx/Data/zone.hpp>
13-
#include <OpenGraphCxx/Util/assert.hpp>
13+
#include <OpenGraphCxx/Misc/assert.hpp>
1414
#include <sys/mman.h>
1515
#include <dispatch/dispatch.h>
1616
#if OG_TARGET_OS_DARWIN
@@ -29,7 +29,7 @@ namespace OG {
2929
namespace data {
3030

3131
#if OG_TARGET_OS_DARWIN
32-
malloc_zone_t *_Nullable _malloc_zone;
32+
malloc_zone_t *table::_malloc_zone = nullptr;
3333
#endif
3434

3535
table &table::ensure_shared() {
@@ -242,9 +242,9 @@ void table::dealloc_page_locked(ptr<page> page) OG_NOEXCEPT {
242242
}
243243
}
244244

245-
// TO BE AUDITED
246-
uint64_t table::raw_page_seed(ptr<page> page) OG_NOEXCEPT {
247-
page.assert_valid(_data_capacity);
245+
OG_CONSTEXPR
246+
uint64_t table::raw_page_seed(ptr<page> page) const OG_NOEXCEPT {
247+
assert_valid(page);
248248
lock();
249249
uint32_t page_index = page.page_index();
250250
uint32_t map_index = page_index / pages_per_map;
@@ -255,8 +255,8 @@ uint64_t table::raw_page_seed(ptr<page> page) OG_NOEXCEPT {
255255
if (map_index < _page_metadata_maps.size() && _page_metadata_maps[map_index].test(page_index % page_size)) {
256256
auto info = page->zone->info();
257257
// FIXME
258-
w22 = info.to_raw_value() & 0xffffff00;
259-
w21 = info.to_raw_value() & 0x000000ff;
258+
w22 = info.value() & 0xffffff00;
259+
w21 = info.value() & 0x000000ff;
260260
result = uint64_t(1) << 32;
261261
}
262262
unlock();
@@ -267,9 +267,9 @@ void table::print() const OG_NOEXCEPT {
267267
lock();
268268
fprintf(stderr, "data::table %p:\n %.2fKB allocated, %.2fKB used, %.2fKB reusable.\n",
269269
this,
270-
double(_region_capacity - page_size) / 1024.0,
270+
double(region_capacity() - page_size) / 1024.0,
271271
double(this->used_pages_num()) / 1024.0,
272-
double(_reusable_pages_num) / 1024.0);
272+
double(reusable_pages_num()) / 1024.0);
273273
unlock();
274274
}
275275

Sources/OpenGraphCxx/Data/zone.cpp

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#include <OpenGraphCxx/Data/zone.hpp>
66
#include <OpenGraphCxx/Data/table.hpp>
77
#include <OpenGraphCxx/Data/page.hpp>
8-
#include <OpenGraphCxx/Util/assert.hpp>
8+
#include <OpenGraphCxx/Misc/assert.hpp>
99
#if OG_TARGET_OS_DARWIN
1010
#include <malloc/malloc.h>
1111
#else
@@ -15,7 +15,17 @@
1515
namespace OG {
1616
namespace data {
1717

18-
void zone::clear() OG_NOEXCEPT {
18+
//zone::zone() : _info(info(shared_table().make_zone_id())) {}
19+
20+
//zone::~zone() {
21+
// clear();
22+
//
23+
//}
24+
25+
void zone::clear() {
26+
// for (auto &element : malloc_buffers()) {
27+
// element.reset();
28+
// }
1929
shared_table().lock();
2030
while (last_page()) {
2131
auto page = last_page();
@@ -121,7 +131,7 @@ void zone::print() const OG_NOEXCEPT {
121131
);
122132
}
123133

124-
void zone::print_header() OG_NOEXCEPT {
134+
void zone::print_header() const OG_NOEXCEPT {
125135
fprintf(stderr, "Zones\n%-16s %6s %8s %8s %6s %6s %6s %8s\n",
126136
"zone ptr", "pages", "total", "in-use", "free", "bytes", "malloc", "total");
127137
}

Sources/OpenGraphCxx/DebugServer/og-debug-server.mm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
#if OG_TARGET_OS_DARWIN
99

1010
#include <OpenGraph/OGGraphDescription.h>
11-
#include <OpenGraphCxx/Util/log.hpp>
12-
#include <OpenGraphCxx/Util/assert.hpp>
11+
#include <OpenGraphCxx/Misc/log.hpp>
12+
#include <OpenGraphCxx/Misc/assert.hpp>
1313
#include <OpenGraphCxx/Graph/Graph.hpp>
1414

1515
#include <iostream>

Sources/OpenGraphCxx/Graph/GraphContext.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
#include <OpenGraphCxx/Graph/Graph.hpp>
66
#include <OpenGraph/OGGraph.h>
7-
#include <OpenGraphCxx/Util/assert.hpp>
7+
#include <OpenGraphCxx/Misc/assert.hpp>
88

99
OG::Graph::Context &OG::Graph::Context::from_cf(OGGraphRef storage) OG_NOEXCEPT {
1010
if (storage->context.isInvalid()) {

Sources/OpenGraphCxx/Graph/GraphDescription.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#include <OpenGraph/OGGraphDescription.h>
66
#include <OpenGraph/OGGraph.h>
77
#include <OpenGraphCxx/Graph/Graph.hpp>
8-
#include <OpenGraphCxx/Util/assert.hpp>
8+
#include <OpenGraphCxx/Misc/assert.hpp>
99

1010
CFTypeRef OGGraphDescription(OGGraphRef graph, CFDictionaryRef options) {
1111
#if OG_OBJC_FOUNDATION

Sources/OpenGraphCxx/Graph/GraphDescription.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#include <OpenGraph/OGGraphDescription.h>
66
#include <OpenGraph/OGGraph.h>
77
#include <OpenGraphCxx/Graph/Graph.hpp>
8-
#include <OpenGraphCxx/Util/assert.hpp>
8+
#include <OpenGraphCxx/Misc/assert.hpp>
99

1010
#if OG_OBJC_FOUNDATION
1111

Sources/OpenGraphCxx/Graph/OGGraph.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
#include <OpenGraph/OGGraph.h>
66
#include <OpenGraphCxx/Graph/Graph.hpp>
7-
#include <OpenGraphCxx/Util/assert.hpp>
7+
#include <OpenGraphCxx/Misc/assert.hpp>
88
#include <OpenGraphCxx/Data/ClosureFunction.hpp>
99
#include <pthread.h>
1010

Sources/OpenGraphCxx/Graph/OGSubgraph.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
#include <OpenGraph/OGGraph.h>
77
#include <OpenGraphCxx/Graph/Subgraph.hpp>
88
#include <OpenGraph/OGGraphContext.h>
9-
#include <OpenGraphCxx/Util/assert.hpp>
10-
#include <OpenGraphCxx/Util/env.hpp>
9+
#include <OpenGraphCxx/Misc/assert.hpp>
10+
#include <OpenGraphCxx/Misc/env.hpp>
1111
#include <pthread.h>
1212
#if !OG_TARGET_OS_WASI
1313
#include <dispatch/dispatch.h>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// assert.cpp
33
// OpenGraphCxx
44

5-
#include <OpenGraphCxx/Util/assert.hpp>
6-
#include <OpenGraphCxx/Util/log.hpp>
5+
#include <OpenGraphCxx/Misc/assert.hpp>
6+
#include <OpenGraphCxx/Misc/log.hpp>
77

88
#include <stdio.h>
99
#include <stdlib.h>

0 commit comments

Comments
 (0)