~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/pbms/src/cslib/CSMemory.cc

  • Committer: Lee Bieber
  • Date: 2010-10-22 16:47:38 UTC
  • mfrom: (1841.1.7 drizzle_pbms)
  • Revision ID: kalebral@gmail.com-20101022164738-vv8w22b8towpb307
Merge Barry - fix bug 657830: PBMS build failure in GCC 4.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
599
599
        if (!track_me && !mm_tracking_id)
600
600
                return;
601
601
 
602
 
 
603
602
        if (func) {
604
603
                cs_format_context(300, buffer, func, file, line);
605
604
                fprintf(stderr, "TRACKING (%"PRIu32"): %s %2"PRIu32" %s", debug_ptr->md_id, inc ? "INC" : "DEC", ref_cnt, buffer);
672
671
#endif
673
672
}
674
673
 
 
674
#ifdef DEBUG
 
675
uint32_t cs_mm_get_check_point()
 
676
{
 
677
        return mm_alloc_count;
 
678
}
 
679
 
 
680
// Reports any memory allocated after the check_point
 
681
// but has not been freed.
 
682
void cs_mm_assert_check_point(uint32_t check_point)
 
683
{
 
684
        uint32_t mm;
 
685
 
 
686
        if (!mm_addresses)
 
687
                return;
 
688
 
 
689
        pthread_mutex_lock(&mm_mutex);
 
690
        for (mm=0; mm<mm_nr_in_use; mm++) {
 
691
                if (mm_addresses[mm].id >= check_point)
 
692
                        mm_throw_assertion(&mm_addresses[mm], mm_addresses[mm].ptr, "Not freed");
 
693
        }
 
694
 
 
695
        pthread_mutex_unlock(&mm_mutex);
 
696
 
 
697
}
 
698
#endif