~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

  • Committer: Mark Atwood
  • Date: 2011-11-15 07:54:33 UTC
  • mfrom: (2459.1.1 fix-oneiric-build)
  • Revision ID: me@mark.atwood.name-20111115075433-ec9wxcw5hddkea2e
mergeĀ lp:~stewart/drizzle/fix-gcc46-build

Show diffs side-by-side

added added

removed removed

Lines of Context:
311
311
        unsigned char   *ptr = (unsigned char *) p - MEM_DEBUG_HDR_SIZE;
312
312
        MemoryDebugPtr  debug_ptr = (MemoryDebugPtr) ptr;
313
313
        size_t                  size = debug_ptr->size;
314
 
        long                    a_value;  /* Added to simplfy debugging. */
315
314
 
316
315
        if (!ASSERT(p)) 
317
316
                return(0);
318
317
        if (!ASSERT(((size_t) p & 1L) == 0)) 
319
318
                return(0);
320
 
        a_value = MEM_FREED;
 
319
 
321
320
        if (debug_ptr->check == MEM_FREED) { 
322
321
                mm_println("MM ERROR: Pointer already freed 'debug_ptr->check != MEM_FREED'");
323
322
                return(0);
324
323
        }
325
 
        a_value = MEM_HEADER;
 
324
 
326
325
        if (debug_ptr->check != MEM_HEADER) {
327
326
                mm_println("MM ERROR: Header not valid 'debug_ptr->check != MEM_HEADER'");
328
327
                return(0);
329
328
        }
330
 
        a_value = MEM_TRAILER_BYTE;
 
329
 
331
330
        if (!(*((unsigned char *) ptr + size + MEM_DEBUG_HDR_SIZE) == MEM_TRAILER_BYTE &&
332
331
                        *((unsigned char *) ptr + size + MEM_DEBUG_HDR_SIZE + 1L) == MEM_TRAILER_BYTE)) { 
333
332
                mm_throw_assertion(mm_ptr, p, "Trailer overwritten");