"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "goo/gmem.cc" between
xpdf-4.01.01.tar.gz and xpdf-4.02.tar.gz

About: Xpdf is a PDF viewer for X.

gmem.cc  (xpdf-4.01.01):gmem.cc  (xpdf-4.02)
skipping to change at line 14 skipping to change at line 14
* Memory routines with out-of-memory checking. * Memory routines with out-of-memory checking.
* *
* Copyright 1996-2003 Glyph & Cog, LLC * Copyright 1996-2003 Glyph & Cog, LLC
*/ */
#include <aconf.h> #include <aconf.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <stddef.h> #include <stddef.h>
// older compilers won't define SIZE_MAX in stdint.h without this // older compilers won't define SIZE_MAX in stdint.h without this
#define __STDC_LIMIT_MACROS 1 #ifndef __STDC_LIMIT_MACROS
# define __STDC_LIMIT_MACROS 1
#endif
#include <stdint.h> #include <stdint.h>
#include <string.h> #include <string.h>
#include <limits.h> #include <limits.h>
#if MULTITHREADED && defined(_WIN32) #if MULTITHREADED && defined(_WIN32)
# include <windows.h> # include <windows.h>
#endif #endif
#include "gmem.h" #include "gmem.h"
#ifdef DEBUG_MEM #ifdef DEBUG_MEM
skipping to change at line 110 skipping to change at line 112
} }
size1 = gMemDataSize(size); size1 = gMemDataSize(size);
if (!(mem = (char *)malloc(size1 + gMemHdrSize + gMemTrlSize))) { if (!(mem = (char *)malloc(size1 + gMemHdrSize + gMemTrlSize))) {
gMemError("Out of memory"); gMemError("Out of memory");
} }
hdr = (GMemHdr *)mem; hdr = (GMemHdr *)mem;
data = (void *)(mem + gMemHdrSize); data = (void *)(mem + gMemHdrSize);
trl = (unsigned long *)(mem + gMemHdrSize + size1); trl = (unsigned long *)(mem + gMemHdrSize + size1);
hdr->magic = gMemMagic; hdr->magic = gMemMagic;
hdr->size = size; hdr->size = size;
gMemLock;
if (ignore) { if (ignore) {
hdr->index = -1; hdr->index = -1;
} else { } else {
hdr->index = gMemIndex++; hdr->index = gMemIndex++;
} }
gMemLock;
if (gMemTail) { if (gMemTail) {
gMemTail->next = hdr; gMemTail->next = hdr;
hdr->prev = gMemTail; hdr->prev = gMemTail;
gMemTail = hdr; gMemTail = hdr;
} else { } else {
hdr->prev = NULL; hdr->prev = NULL;
gMemHead = gMemTail = hdr; gMemHead = gMemTail = hdr;
} }
hdr->next = NULL; hdr->next = NULL;
++gMemAlloc; ++gMemAlloc;
skipping to change at line 236 skipping to change at line 238
} }
size1 = gMemDataSize64(size); size1 = gMemDataSize64(size);
if (!(mem = (char *)malloc(size1 + gMemHdrSize + gMemTrlSize))) { if (!(mem = (char *)malloc(size1 + gMemHdrSize + gMemTrlSize))) {
gMemError("Out of memory"); gMemError("Out of memory");
} }
hdr = (GMemHdr *)mem; hdr = (GMemHdr *)mem;
data = (void *)(mem + gMemHdrSize); data = (void *)(mem + gMemHdrSize);
trl = (unsigned long *)(mem + gMemHdrSize + size1); trl = (unsigned long *)(mem + gMemHdrSize + size1);
hdr->magic = gMemMagic; hdr->magic = gMemMagic;
hdr->size = size; hdr->size = size;
gMemLock;
if (ignore) { if (ignore) {
hdr->index = -1; hdr->index = -1;
} else { } else {
hdr->index = gMemIndex++; hdr->index = gMemIndex++;
} }
gMemLock;
if (gMemTail) { if (gMemTail) {
gMemTail->next = hdr; gMemTail->next = hdr;
hdr->prev = gMemTail; hdr->prev = gMemTail;
gMemTail = hdr; gMemTail = hdr;
} else { } else {
hdr->prev = NULL; hdr->prev = NULL;
gMemHead = gMemTail = hdr; gMemHead = gMemTail = hdr;
} }
hdr->next = NULL; hdr->next = NULL;
++gMemAlloc; ++gMemAlloc;
 End of changes. 5 change blocks. 
3 lines changed or deleted 5 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)