Changeset ccd333 in git


Ignore:
Timestamp:
Apr 7, 2011, 12:51:37 PM (13 years ago)
Author:
Mohamed Barakat <mohamed.barakat@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'fc741b6502fd8a97288eaa3eba6e5220f3c3df87')
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
Message:
- seperated public config macros in omalloc from private ones
- deleted OM_PROVIDE_MALLOC and OM_EMULATE_OMALLOC
- protect libpolys/misc/mylimits.h from double-include
- enlarged .gitignore :)
Files:
2 added
6 edited

Legend:

Unmodified
Added
Removed
  • .gitignore

    r028192 rccd333  
    1010*.la
    1111.libs
     12configure
     13config.h.in
     14config.sub
     15config.guess
     16config.h
     17config.status
     18ntl/*
    1219libpolys/polys/templates/p_Procs_Generate
    1320libpolys/polys/m4/
    1421libpolys/coeffs/test
     22libpolys/coeffs/test-g
     23libpolys/polys/templates/.dirstamp
    1524depend
    1625tags
     
    2231Makefile.in
    2332install-sh
    24 config*
    2533!configure.ac
    2634GNUMakefile
     
    3240x86_64-Linux/*
    3341ix86Mac-darwin/*
     42omalloc/stamp-h3
    3443omalloc/Makefile.in
    35 omalloc/omConfig.h.in
    3644omalloc/omTables
    3745omalloc/omTables.h
  • libpolys/misc/mylimits.h

    r028192 rccd333  
    1414
    1515#ifndef _MYLIMITS_H
    16 
     16#define _MYLIMITS_H
    1717#ifdef IRIX
    1818#include <omalloc/omlimits.h>
  • omalloc/configure.ac

    r028192 rccd333  
    4343  [ --with-valloc=mmap|system|emulate
    4444                    how to get page-aligned memory, default: use first possible])
    45 AC_ARG_WITH(
    46   provide-malloc,
    47   [ --with-provide-malloc=yes|debug|malloc
    48                     provide normal|debug|underlying malloc ANSI-C conforming
    49                     versions of malloc|calloc|realloc|free])
    50 AC_ARG_WITH(
    51   emulate-omalloc,
    52   [ --with-emulate-omalloc
    53                     provide only omallocs interface, but do not use its features])
    5445AC_ARG_WITH(
    5546  align,
     
    249240  AC_DEFINE(OMALLOC_USES_MALLOC,1,the system allocator is called malloc)
    250241  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; then
    252     AC_MSG_ERROR("can not provide malloc for --with-malloc=system")
    253   fi
    254242elif test "${with_malloc}" = gmalloc; then
    255243  AC_DEFINE(OMALLOC_USES_GMALLOC,1,use gmalloc as system allocator)
     
    263251  if test "${with_external_malloc_h+set}" != set; then
    264252    AC_MSG_ERROR(need --with_external_malloc_h for external malloc)
    265   fi
    266   if test "${with_provide_malloc}" = yes || test "${with_provide_malloc}" = debug; then
    267     AC_MSG_ERROR("can not provide malloc for --with_malloc=external")
    268253  fi
    269254  AC_DEFINE(OMALLOC_USES_EXTERNAL_MALLOC,1,use external malloc as system allocator)
     
    280265  AC_DEFINE(OMALLOC_USES_MALLOC,1,the system allocator is called malloc)
    281266  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; then
    283     AC_MSG_ERROR("can not provide malloc for --with-malloc=system")
    284   fi
    285267fi
    286268AC_MSG_RESULT($with_malloc)
     
    320302if test "$ac_cv_malloc_sizeof_addr" != no; then
    321303AC_DEFINE(OM_MALLOC_PROVIDES_SIZEOF_ADDR,1,"Whether malloc provides SIZEOF_ADDR")
    322 fi
    323 
    324 if test "${with_provide_malloc}" = malloc; then
    325    AC_DEFINE(OM_PROVIDE_MALLOC, 3, "Malloc type 3")
    326 elif test "${with_provide_malloc}" = debug; then
    327    AC_DEFINE(OM_PROVIDE_MALLOC, 2, "Malloc debug-mode")
    328 elif test "${with_provide_malloc}" = yes; then
    329   AC_DEFINE(OM_PROVIDE_MALLOC, 1, "Malloc type 1")
    330 else
    331   AC_DEFINE(OM_PROVIDE_MALLOC, 0, "No malloc")
    332304fi
    333305
     
    383355fi
    384356AC_MSG_RESULT($with_valloc)
    385 
    386 dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
    387 dnl emulation
    388 dnl
    389 AC_MSG_CHECKING(whether to emulate omalloc)
    390 if test "${with_emulate_omalloc}" = yes; then
    391   AC_DEFINE(OM_EMULATE_OMALLOC,1,"Emulate omalloc")
    392   AC_MSG_RESULT(yes)
    393 else
    394   AC_MSG_RESULT(no)
    395 fi
    396357
    397358dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
     
    616577dnl wrap it up
    617578dnl
    618 AC_CONFIG_HEADER(omConfig.h omlimits.h)
     579AC_CONFIG_HEADER(config.h omConfig.h omlimits.h)
    619580
    620581AC_OUTPUT(Makefile, \
  • omalloc/omAllocDecl.h

    r028192 rccd333  
    2121
    2222
    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)
    2424
    2525/*******************************************************************
     
    208208#endif /* OM_ALIGNMENT_NEEDS_WORK */
    209209
    210 #elif !defined(OM_EMULATE_OMALLOC)
     210#else
    211211/*******************************************************************
    212212 *
     
    277277#define omMemDup(s)         _omMemDup(s)
    278278
    279 
    280 
    281 #else /* OM_EMULATE_OMALLOC */
    282 /*******************************************************************
    283  *
    284  * Emulation of omalloc's Alloc/Free interface
    285  *
    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)
    322279#endif /* ! debug && ! the real thing */
    323280
     
    391348
    392349
    393 #if !defined(OM_NDEBUG) && !defined(OM_EMULATE_MALLOC)
     350#if !defined(OM_NDEBUG)
    394351omError_t omTestAddrBin(void* addr, omBin bin, int check_level);
    395352omError_t omTestBinAddr(void* addr, int check_level);
  • omalloc/omAllocEmulate.c

    r028192 rccd333  
    4040  return addr;
    4141}
    42 
    43 #if defined(OM_EMULATE_OMALLOC) && defined(OM_PROVIDE_MALLOC)
    44 
    45 #undef calloc
    46 #undef malloc
    47 #undef realloc
    48 #undef free
    49 
    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  
    99#define OM_MALLOC_H
    1010
    11 #include <omalloc/omConfig.h>
     11#include "config.h"
    1212
    1313#ifdef OMALLOC_USES_SYSTEM_MALLOC
Note: See TracChangeset for help on using the changeset viewer.