Changeset ccd333 in git
- Timestamp:
- Apr 7, 2011, 12:51:37 PM (12 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'f875bbaccd0831e36aaed09ff6adeb3eb45aeb94')
- Children:
- 819bad2d3138c61204e2e017596f91b9cc52f981
- Parents:
- 02819271608a70447cc6f58ebf01668dbafc6cf2
- git-author:
- Mohamed Barakat <mohamed.barakat@rwth-aachen.de>2011-04-07 12:51:37+02:00
- git-committer:
- Mohamed Barakat <mohamed.barakat@rwth-aachen.de>2011-11-09 12:04:18+01:00
- Files:
-
- 2 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
.gitignore
r028192 rccd333 10 10 *.la 11 11 .libs 12 configure 13 config.h.in 14 config.sub 15 config.guess 16 config.h 17 config.status 18 ntl/* 12 19 libpolys/polys/templates/p_Procs_Generate 13 20 libpolys/polys/m4/ 14 21 libpolys/coeffs/test 22 libpolys/coeffs/test-g 23 libpolys/polys/templates/.dirstamp 15 24 depend 16 25 tags … … 22 31 Makefile.in 23 32 install-sh 24 config*25 33 !configure.ac 26 34 GNUMakefile … … 32 40 x86_64-Linux/* 33 41 ix86Mac-darwin/* 42 omalloc/stamp-h3 34 43 omalloc/Makefile.in 35 omalloc/omConfig.h.in36 44 omalloc/omTables 37 45 omalloc/omTables.h -
libpolys/misc/mylimits.h
r028192 rccd333 14 14 15 15 #ifndef _MYLIMITS_H 16 16 #define _MYLIMITS_H 17 17 #ifdef IRIX 18 18 #include <omalloc/omlimits.h> -
omalloc/configure.ac
r028192 rccd333 43 43 [ --with-valloc=mmap|system|emulate 44 44 how to get page-aligned memory, default: use first possible]) 45 AC_ARG_WITH(46 provide-malloc,47 [ --with-provide-malloc=yes|debug|malloc48 provide normal|debug|underlying malloc ANSI-C conforming49 versions of malloc|calloc|realloc|free])50 AC_ARG_WITH(51 emulate-omalloc,52 [ --with-emulate-omalloc53 provide only omallocs interface, but do not use its features])54 45 AC_ARG_WITH( 55 46 align, … … 249 240 AC_DEFINE(OMALLOC_USES_MALLOC,1,the system allocator is called malloc) 250 241 AC_DEFINE(OMALLOC_USES_SYSTEM_MALLOC,1,use system malloc as system allocator) 251 if test "${with_provide_malloc}" = yes || test "${with_provide_malloc}" = debug; then252 AC_MSG_ERROR("can not provide malloc for --with-malloc=system")253 fi254 242 elif test "${with_malloc}" = gmalloc; then 255 243 AC_DEFINE(OMALLOC_USES_GMALLOC,1,use gmalloc as system allocator) … … 263 251 if test "${with_external_malloc_h+set}" != set; then 264 252 AC_MSG_ERROR(need --with_external_malloc_h for external malloc) 265 fi266 if test "${with_provide_malloc}" = yes || test "${with_provide_malloc}" = debug; then267 AC_MSG_ERROR("can not provide malloc for --with_malloc=external")268 253 fi 269 254 AC_DEFINE(OMALLOC_USES_EXTERNAL_MALLOC,1,use external malloc as system allocator) … … 280 265 AC_DEFINE(OMALLOC_USES_MALLOC,1,the system allocator is called malloc) 281 266 AC_DEFINE(OMALLOC_USES_SYSTEM_MALLOC,1,use system malloc as system allocator) 282 if test "${with_provide_malloc}" = yes || test "${with_provide_malloc}" = debug; then283 AC_MSG_ERROR("can not provide malloc for --with-malloc=system")284 fi285 267 fi 286 268 AC_MSG_RESULT($with_malloc) … … 320 302 if test "$ac_cv_malloc_sizeof_addr" != no; then 321 303 AC_DEFINE(OM_MALLOC_PROVIDES_SIZEOF_ADDR,1,"Whether malloc provides SIZEOF_ADDR") 322 fi323 324 if test "${with_provide_malloc}" = malloc; then325 AC_DEFINE(OM_PROVIDE_MALLOC, 3, "Malloc type 3")326 elif test "${with_provide_malloc}" = debug; then327 AC_DEFINE(OM_PROVIDE_MALLOC, 2, "Malloc debug-mode")328 elif test "${with_provide_malloc}" = yes; then329 AC_DEFINE(OM_PROVIDE_MALLOC, 1, "Malloc type 1")330 else331 AC_DEFINE(OM_PROVIDE_MALLOC, 0, "No malloc")332 304 fi 333 305 … … 383 355 fi 384 356 AC_MSG_RESULT($with_valloc) 385 386 dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll387 dnl emulation388 dnl389 AC_MSG_CHECKING(whether to emulate omalloc)390 if test "${with_emulate_omalloc}" = yes; then391 AC_DEFINE(OM_EMULATE_OMALLOC,1,"Emulate omalloc")392 AC_MSG_RESULT(yes)393 else394 AC_MSG_RESULT(no)395 fi396 357 397 358 dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll … … 616 577 dnl wrap it up 617 578 dnl 618 AC_CONFIG_HEADER( omConfig.h omlimits.h)579 AC_CONFIG_HEADER(config.h omConfig.h omlimits.h) 619 580 620 581 AC_OUTPUT(Makefile, \ -
omalloc/omAllocDecl.h
r028192 rccd333 21 21 22 22 23 #if (!defined(OM_ EMULATE_OMALLOC) && !defined(OM_NDEBUG) && (defined(OM_CHECK) || (defined(OM_HAVE_TRACK) && defined(OM_TRACK)))) || defined(OM_T1)23 #if (!defined(OM_NDEBUG) && (defined(OM_CHECK) || (defined(OM_HAVE_TRACK) && defined(OM_TRACK)))) || defined(OM_T1) 24 24 25 25 /******************************************************************* … … 208 208 #endif /* OM_ALIGNMENT_NEEDS_WORK */ 209 209 210 #el if !defined(OM_EMULATE_OMALLOC)210 #else 211 211 /******************************************************************* 212 212 * … … 277 277 #define omMemDup(s) _omMemDup(s) 278 278 279 280 281 #else /* OM_EMULATE_OMALLOC */282 /*******************************************************************283 *284 * Emulation of omalloc's Alloc/Free interface285 *286 *******************************************************************/287 288 #include <omalloc/omMalloc.h>289 290 extern void* omEmulateCalloc(size_t size);291 extern void* omEmulateRealloc0Size(void* o_addr, size_t o_size, size_t n_size);292 extern void* omEmulateRealloc0(void* o_addr, size_t n_size);293 294 #define omTypeAllocBin(type,addr,bin) addr=(type) OM_MALLOC_MALLOC(bin->sizeW << LOG_SIZEOF_LONG)295 #define omTypeAlloc0Bin(type,addr,bin) addr=(type) omEmulateAlloc0(bin->sizeW << LOG_SIZEOF_LONG)296 #define omAllocBin(bin) OM_MALLOC_MALLOC(bin->sizeW << LOG_SIZEOF_LONG)297 #define omAlloc0Bin(bin) omEmulateAlloc0(bin->sizeW << LOG_SIZEOF_LONG)298 299 #define omTypeAlloc(type,addr,size) addr=(type) OM_MALLOC_MALLOC(size)300 #define omTypeAlloc0(type,addr,size) addr=(type) omEmulateAlloc0(size)301 #define omAlloc(size) OM_MALLOC_MALLOC(size)302 #define omAlloc0(size) omEmulateAlloc0(size)303 304 #define omTypeReallocBin(o_addr,o_bin,type,addr,bin) addr=(type)OM_MALLOC_REALLOC(o_addr,bin->sizeW << LOG_SIZEOF_LONG)305 #define omTypeRealloc0Bin(o_addr,o_bin,type,addr,bin) addr=(type)omEmulateRealloc0Size(o_addr,o_bin->sizeW << LOG_SIZEOF_LONG,bin->sizeW << LOG_SIZEOF_LONG)306 #define omReallocBin(o_addr,o_bin,bin) OM_MALLOC_REALLOC(o_addr,bin->sizeW << LOG_SIZEOF_LONG)307 #define omRealloc0Bin(o_addr,o_bin,bin) omEmulateRealloc0Size(o_addr,o_bin->sizeW << LOG_SIZEOF_LONG,bin->sizeW << LOG_SIZEOF_LONG)308 309 #define omTypeReallocSize(o_addr,o_size,type,addr,size) addr=(type)OM_MALLOC_REALLOC(o_addr,size)310 #define omTypeRealloc0Size(o_addr,o_size,type,addr,size) addr=(type)omEmulateRealloc0Size(o_addr,o_size,size)311 #define omReallocSize(addr,o_size,size) OM_MALLOC_REALLOC(addr,size)312 #define omRealloc0Size(addr,o_size,size) omEmulateRealloc0Size(addr,o_size,size)313 314 #define omTypeRealloc(o_addr,type,addr,size) addr=(type)OM_MALLOC_REALLOC(o_addr,size)315 #define omTypeRealloc0(o_addr,type,addr,size) addr=(type)omEmulateRealloc0(o_addr,size)316 #define omRealloc(addr,size) OM_MALLOC_REALLOC(addr,size)317 #define omRealloc0(addr,size) omEmulateRealloc0(addr,size)318 319 #define omFreeBin(addr,bin) OM_MALLOC_FREE(addr)320 #define omFreeSize(addr,size) OM_MALLOC_FREE(addr)321 #define omFree(addr) OM_MALLOC_FREE(addr)322 279 #endif /* ! debug && ! the real thing */ 323 280 … … 391 348 392 349 393 #if !defined(OM_NDEBUG) && !defined(OM_EMULATE_MALLOC)350 #if !defined(OM_NDEBUG) 394 351 omError_t omTestAddrBin(void* addr, omBin bin, int check_level); 395 352 omError_t omTestBinAddr(void* addr, int check_level); -
omalloc/omAllocEmulate.c
r028192 rccd333 40 40 return addr; 41 41 } 42 43 #if defined(OM_EMULATE_OMALLOC) && defined(OM_PROVIDE_MALLOC)44 45 #undef calloc46 #undef malloc47 #undef realloc48 #undef free49 50 void* calloc(size_t n, size_t s)51 {52 return omEmulateAlloc0(n*s);53 }54 55 void* malloc(size_t size)56 {57 return OM_MALLOC_MALLOC(size);58 }59 60 void* realloc(void* o_addr, size_t n_size);61 {62 return OM_MALLOC_REALLOC(size);63 }64 65 void free(void* addr)66 {67 OM_MALLOC_FREE(addr);68 }69 70 #endif /* defined(OM_EMULATE_OMALLOC) && defined(OM_PROVIDE_MALLOC) */ -
omalloc/omMalloc.h
r028192 rccd333 9 9 #define OM_MALLOC_H 10 10 11 #include <omalloc/omConfig.h>11 #include "config.h" 12 12 13 13 #ifdef OMALLOC_USES_SYSTEM_MALLOC
Note: See TracChangeset
for help on using the changeset viewer.