Changeset 8ae02b9 in git
- Timestamp:
- Oct 16, 2007, 10:45:35 AM (17 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- d011a2dfd5880603d857e304e27421ab9d269fed
- Parents:
- 7cb56a987e093ab0f0d2d3ae33f0b891c39bf5fb
- Location:
- omalloc
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
omalloc/dlmalloc.c
r7cb56a9 r8ae02b9 4 4 * This was obtained by taking cutting out the end of malloc.c 5 5 * 6 * Version: $Id: dlmalloc.c,v 1. 4 2001-04-30 09:01:57Singular Exp $6 * Version: $Id: dlmalloc.c,v 1.5 2007-10-16 08:45:35 Singular Exp $ 7 7 *******************************************************************/ 8 8 #ifdef HAVE_CONFIG_H … … 1675 1675 newsize += prevsize + nextsize; 1676 1676 newmem = chunk2mem(newp); 1677 MALLOC_ COPY(newmem, oldmem, oldsize - SIZE_SZ);1677 MALLOC_MOVE(newmem, oldmem, oldsize - SIZE_SZ); 1678 1678 top = chunk_at_offset(newp, nb); 1679 1679 set_head(top, (newsize - nb) | PREV_INUSE); … … 1691 1691 newsize += nextsize + prevsize; 1692 1692 newmem = chunk2mem(newp); 1693 MALLOC_ COPY(newmem, oldmem, oldsize - SIZE_SZ);1693 MALLOC_MOVE(newmem, oldmem, oldsize - SIZE_SZ); 1694 1694 goto split; 1695 1695 } … … 1703 1703 newsize += prevsize; 1704 1704 newmem = chunk2mem(newp); 1705 MALLOC_ COPY(newmem, oldmem, oldsize - SIZE_SZ);1705 MALLOC_MOVE(newmem, oldmem, oldsize - SIZE_SZ); 1706 1706 goto split; 1707 1707 } -
omalloc/dlmalloc.h
r7cb56a9 r8ae02b9 4 4 * This was obtained by taking cutting out the beginning of malloc.c 5 5 * 6 * Version: $Id: dlmalloc.h,v 1.1 0 2005-11-08 13:53:37 brickenExp $6 * Version: $Id: dlmalloc.h,v 1.11 2007-10-16 08:45:35 Singular Exp $ 7 7 *******************************************************************/ 8 8 #ifndef DL_MALLOC_H … … 455 455 } while(0) 456 456 457 #define MALLOC_MOVE(dest,src,nbytes) \ 458 do { \ 459 INTERNAL_SIZE_T mcsz = (nbytes); \ 460 if(mcsz <= 9*sizeof(mcsz)) { \ 461 INTERNAL_SIZE_T* mcsrc = (INTERNAL_SIZE_T*) (src); \ 462 INTERNAL_SIZE_T* mcdst = (INTERNAL_SIZE_T*) (dest); \ 463 if(mcsz >= 5*sizeof(mcsz)) { *mcdst++ = *mcsrc++; \ 464 *mcdst++ = *mcsrc++; \ 465 if(mcsz >= 7*sizeof(mcsz)) { *mcdst++ = *mcsrc++; \ 466 *mcdst++ = *mcsrc++; \ 467 if(mcsz >= 9*sizeof(mcsz)) { *mcdst++ = *mcsrc++; \ 468 *mcdst++ = *mcsrc++; }}} \ 469 *mcdst++ = *mcsrc++; \ 470 *mcdst++ = *mcsrc++; \ 471 *mcdst = *mcsrc ; \ 472 } else memmove(dest, src, mcsz); \ 473 } while(0) 474 457 475 #else /* !USE_MEMCPY */ 458 476 … … 493 511 } \ 494 512 } while(0) 513 514 #define MALLOC_MOVE(dest,src,nbytes) MALLOC_COPY(dest,src,nbytes) 495 515 496 516 #endif … … 849 869 850 870 #if __STD_C 851 #ifndef __MACH__ 871 #ifndef __MACH__ 852 872 extern Void_t* sbrk(ptrdiff_t); 853 #else 873 #else 854 874 extern void *sbrk(int); 855 875 #endif
Note: See TracChangeset
for help on using the changeset viewer.