Skip to content

Commit

Permalink
Fix DEBUG_GUARD
Browse files Browse the repository at this point in the history
Some updates to header stuff apparently were missed. Not sure I
got this entirely right but it looks ok and builds.
  • Loading branch information
Bike committed Nov 5, 2024
1 parent 4e3ceea commit e3287ed
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
15 changes: 13 additions & 2 deletions include/clasp/gctools/memoryManagement.h
Original file line number Diff line number Diff line change
Expand Up @@ -742,9 +742,9 @@ class Header_s : public BaseHeader_s {
#if !defined(DEBUG_GUARD)
Header_s(const BadgeStampWtagMtag& k) : BaseHeader_s(k){};
Header_s(Header_s* headerptr) : BaseHeader_s(headerptr->_badge_stamp_wtag_mtag){};
Header_s(Header_s* headerptr, bool dummy) : BaseHeader_s(headerptr->_badge_stamp_wtag_mtag, dummy) {
Header_s(Header_s* headerptr, bool verbose) : BaseHeader_s(headerptr->_badge_stamp_wtag_mtag, verbose) {
#ifdef DEBUG_BADGE_SSL
if (dummy)
if (verbose)
printf("%s:%d:%s this = %p headerptr badge = %u badge = %u\n", __FILE__, __LINE__, __FUNCTION__, (void*)this,
headerptr->_badge_stamp_wtag_mtag._header_badge.load(), this->_badge_stamp_wtag_mtag._header_badge.load());
#endif
Expand All @@ -765,6 +765,17 @@ class Header_s : public BaseHeader_s {
Header_s(Header_s* headerptr)
: BaseHeader_s(headerptr->_badge_stamp_wtag_mtag), _guard(GUARD1), _tail_start(0), _tail_size(0), _source(headerptr->_source),
_guard2(GUARD2), _dup_badge_stamp_wtag_mtag(headerptr->_badge_stamp_wtag_mtag){};
Header_s(Header_s* headerptr, bool verbose)
: BaseHeader_s(headerptr->_badge_stamp_wtag_mtag, verbose), _guard(GUARD1),
_tail_start(0), _tail_size(0), _source(headerptr->_source),
_guard2(GUARD2), _dup_badge_stamp_wtag_mtag(headerptr->_badge_stamp_wtag_mtag)
{
#ifdef DEBUG_BADGE_SSL
if (verbose)
printf("%s:%d:%s this = %p headerptr badge = %u badge = %u\n", __FILE__, __LINE__, __FUNCTION__, (void*)this,
headerptr->_badge_stamp_wtag_mtag._header_badge.load(), this->_badge_stamp_wtag_mtag._header_badge.load());
#endif
}

#endif

Expand Down
2 changes: 1 addition & 1 deletion src/gctools/snapshotSaveLoad.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3805,7 +3805,7 @@ void snapshot_load(void* maybeStartOfSnapshot, void* maybeEndOfSnapshot, const s
#ifdef DEBUG_GUARD
// only works when DEBUG_GUARD is on
printf("%s:%d:%s DEBUG_GUARD ON Testing snapshot load memory\n", __FILE__, __LINE__, __FUNCTION__);
gctools::GatherObjects gather;
gctools::GatherObjects gather(gctools::room_test);
gctools::gatherAllObjects(gather);
printf("%s:%d:%s DEBUG_GUARD ON snapshot load memory test report\n", __FILE__, __LINE__, __FUNCTION__);
dump_test_results(stdout, gather);
Expand Down

0 comments on commit e3287ed

Please sign in to comment.