Changeset d83977 in git


Ignore:
Timestamp:
Jan 27, 2001, 6:03:41 PM (23 years ago)
Author:
Olaf Bachmann <obachman@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
f8dcbcb76eacf689bc3c66b8de4226eeba5f741d
Parents:
4e69082e0209f82df529824514e15aea87df0b8e
Message:
Windows port


git-svn-id: file:///usr/local/Singular/svn/trunk@5127 2c84dea3-7e68-4137-9b89-c4e89433aadc
Location:
omalloc
Files:
2 added
10 edited

Legend:

Unmodified
Added
Removed
  • omalloc/Makefile.in

    r4e6908 rd83977  
    44### Author:  obachman@mathematik.uni-kl.de (Olaf Bachmann)
    55### Created: 11/99
    6 ### Version: $Id: Makefile.in,v 1.7 2000-12-14 17:24:30 obachman Exp $
     6### Version: $Id: Makefile.in,v 1.8 2001-01-27 17:03:38 obachman Exp $
    77#################################################################
    88
     
    6464omAllocSystem.c  omError.c        omStats.c        omRet2Info.c   \
    6565omBin.c          omFindExec.c     omDebugTrack.c                   \
    66 omalloc_provide.c        
     66omalloc_provide.c omAllocFunc.c
    6767
    6868ifdef EXTERNAL_CONFIG_SOURCE
     
    8484omBin.h                omDefaultConfig.h      omStructs.h       \
    8585omBinPage.h            omInline.h             omGetBackTrace.h  \
    86 omReturn.h             omRet2Info.h            
     86omReturn.h             omRet2Info.h           omAllocFunc.h            
    8787
    8888OBJS := $(CSOURCES:.c=.o)  $(GSOURCES:.c=.o)
  • omalloc/configure

    r4e6908 rd83977  
    19481948if test "${with_malloc}" = system; then
    19491949  OM_MALLOC_HEADER=omMallocSystem.h
     1950  cat >> confdefs.h <<\EOF
     1951#define OMALLOC_USES_MALLOC 1
     1952EOF
     1953
    19501954  if test "${with_provide_malloc}" = yes || test "${with_provide_malloc}" = debug; then
    19511955    { echo "configure: error: "can not provide malloc for --with-malloc=system"" 1>&2; exit 1; }
     
    19661970  OM_MALLOC_HEADER=$with_external_malloc_h
    19671971  OM_MALLOC_SOURCE=$with_external_malloc_c
     1972  cat >> confdefs.h <<\EOF
     1973#define OMALLOC_USES_MALLOC 1
     1974EOF
     1975
    19681976else
    19691977  with_malloc=dlmalloc
     
    19821990
    19831991echo $ac_n "checking whether malloc provides SizeOfAddr""... $ac_c" 1>&6
    1984 echo "configure:1985: checking whether malloc provides SizeOfAddr" >&5
     1992echo "configure:1993: checking whether malloc provides SizeOfAddr" >&5
    19851993if test "${ac_cv_malloc_sizeof_addr}" = no; then
    19861994  echo "$ac_t""(cached) no" 1>&6
     
    19922000else
    19932001  cat > conftest.$ac_ext <<EOF
    1994 #line 1995 "configure"
     2002#line 2003 "configure"
    19952003#include "confdefs.h"
    19962004
     
    20092017
    20102018EOF
    2011 if { (eval echo configure:2012: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
     2019if { (eval echo configure:2020: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
    20122020then
    20132021  ac_cv_malloc_sizeof_addr="${OM_MALLOC_HEADER}_${OM_MALLOC_SOURCE}"
     
    20572065
    20582066echo $ac_n "checking whether working valloc exists""... $ac_c" 1>&6
    2059 echo "configure:2060: checking whether working valloc exists" >&5
     2067echo "configure:2068: checking whether working valloc exists" >&5
    20602068if test "${ac_cv_working_valloc}" = no; then
    20612069  echo "$ac_t""(cached) no" 1>&6
     
    20672075else
    20682076  cat > conftest.$ac_ext <<EOF
    2069 #line 2070 "configure"
     2077#line 2078 "configure"
    20702078#include "confdefs.h"
    20712079
     
    20852093
    20862094EOF
    2087 if { (eval echo configure:2088: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
     2095if { (eval echo configure:2096: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
    20882096then
    20892097  ac_cv_working_valloc="${OM_MALLOC_HEADER}_${OM_MALLOC_SOURCE}"
     
    21052113
    21062114echo $ac_n "checking which valloc to use""... $ac_c" 1>&6
    2107 echo "configure:2108: checking which valloc to use" >&5
     2115echo "configure:2116: checking which valloc to use" >&5
    21082116if test "${with_valloc+set}" != set || test "${with_valloc}" = mmap; then
    21092117  if test "${ac_cv_working_mmap}" = yes; then
     
    21182126fi
    21192127if test "${with_valloc}" = malloc; then
    2120   if test "{ac_cv_working_valloc}" != no; then
     2128  if test "${ac_cv_working_valloc}" != no; then
    21212129    cat >> confdefs.h <<\EOF
    21222130#define OM_HAVE_VALLOC_MALLOC 1
     
    21302138
    21312139echo $ac_n "checking whether to emulate omalloc""... $ac_c" 1>&6
    2132 echo "configure:2133: checking whether to emulate omalloc" >&5
     2140echo "configure:2141: checking whether to emulate omalloc" >&5
    21332141if test "${with_emulate_omalloc}" = yes; then
    21342142  cat >> confdefs.h <<\EOF
     
    21422150
    21432151echo $ac_n "checking how to align""... $ac_c" 1>&6
    2144 echo "configure:2145: checking how to align" >&5
     2152echo "configure:2153: checking how to align" >&5
    21452153if test "$with_align" = 8 || test "$ac_cv_sizeof_long" = 8; then
    21462154  ac_cv_align=8
     
    21632171
    21642172echo $ac_n "checking whether to use dense bins""... $ac_c" 1>&6
    2165 echo "configure:2166: checking whether to use dense bins" >&5
     2173echo "configure:2174: checking whether to use dense bins" >&5
    21662174if test "$with_dense_bins" = yes; then
    21672175echo "$ac_t""yes" 1>&6
     
    21752183
    21762184echo $ac_n "checking whether to disable debugging""... $ac_c" 1>&6
    2177 echo "configure:2178: checking whether to disable debugging" >&5
     2185echo "configure:2186: checking whether to disable debugging" >&5
    21782186if test "$with_debug" != no; then
    21792187echo "$ac_t""no" 1>&6
     
    21882196
    21892197echo $ac_n "checking whether to have tracking debug functionality""... $ac_c" 1>&6
    2190 echo "configure:2191: checking whether to have tracking debug functionality" >&5
     2198echo "configure:2199: checking whether to have tracking debug functionality" >&5
    21912199if test "$with_track" != no; then
    21922200echo "$ac_t""yes" 1>&6
     
    22002208
    22012209echo $ac_n "checking whether to use internal debug""... $ac_c" 1>&6
    2202 echo "configure:2203: checking whether to use internal debug" >&5
     2210echo "configure:2211: checking whether to use internal debug" >&5
    22032211if test "$with_internal_debug" = yes; then
    22042212echo "$ac_t""yes" 1>&6
     
    22132221
    22142222echo $ac_n "checking whether to inline""... $ac_c" 1>&6
    2215 echo "configure:2216: checking whether to inline" >&5
     2223echo "configure:2224: checking whether to inline" >&5
    22162224if test "$ac_cv_c_inline" != no && test "$with_inline" != no; then
    22172225  cat >> confdefs.h <<EOF
     
    22492257
    22502258echo $ac_n "checking whether GET_RET_ADDR works""... $ac_c" 1>&6
    2251 echo "configure:2252: checking whether GET_RET_ADDR works" >&5
     2259echo "configure:2260: checking whether GET_RET_ADDR works" >&5
    22522260if eval "test \"`echo '$''{'ac_cv_get_return_addr_works'+set}'`\" = set"; then
    22532261  echo $ac_n "(cached) $ac_c" 1>&6
     
    22572265else
    22582266  cat > conftest.$ac_ext <<EOF
    2259 #line 2260 "configure"
     2267#line 2268 "configure"
    22602268#include "confdefs.h"
    22612269
     
    22732281
    22742282EOF
    2275 if { (eval echo configure:2276: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
     2283if { (eval echo configure:2284: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
    22762284then
    22772285  ac_cv_get_return_addr_works=yes
     
    22962304
    22972305echo $ac_n "checking whether omGetBackTrace works""... $ac_c" 1>&6
    2298 echo "configure:2299: checking whether omGetBackTrace works" >&5
     2306echo "configure:2307: checking whether omGetBackTrace works" >&5
    22992307if eval "test \"`echo '$''{'ac_cv_get_backtrace_works'+set}'`\" = set"; then
    23002308  echo $ac_n "(cached) $ac_c" 1>&6
     
    23042312else
    23052313  cat > conftest.$ac_ext <<EOF
    2306 #line 2307 "configure"
     2314#line 2315 "configure"
    23072315#include "confdefs.h"
    23082316
     
    23252333
    23262334EOF
    2327 if { (eval echo configure:2328: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
     2335if { (eval echo configure:2336: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
    23282336then
    23292337  ac_cv_get_backtrace_works=yes
     
    23482356
    23492357echo $ac_n "checking whether addr2line works""... $ac_c" 1>&6
    2350 echo "configure:2351: checking whether addr2line works" >&5
     2358echo "configure:2359: checking whether addr2line works" >&5
    23512359if eval "test \"`echo '$''{'ac_cv_prog_addr2line_works'+set}'`\" = set"; then
    23522360  echo $ac_n "(cached) $ac_c" 1>&6
     
    23562364else
    23572365  cat > conftest.$ac_ext <<EOF
    2358 #line 2359 "configure"
     2366#line 2367 "configure"
    23592367#include "confdefs.h"
    23602368
     
    23892397
    23902398EOF
    2391 if { (eval echo configure:2392: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
     2399if { (eval echo configure:2400: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
    23922400then
    23932401  ac_cv_prog_addr2line_works=yes
     
    24062414 
    24072415echo $ac_n "checking whether to track return addresses""... $ac_c" 1>&6
    2408 echo "configure:2409: checking whether to track return addresses" >&5
     2416echo "configure:2417: checking whether to track return addresses" >&5
    24092417if test "$with_track_return" = no || test "$ac_cv_get_return_addr_works" = no || test "$ac_cv_prog_addr2line_works" != yes; then
    24102418  with_track_return=no
     
    24192427
    24202428echo $ac_n "checking whether to track files and line numbers""... $ac_c" 1>&6
    2421 echo "configure:2422: checking whether to track files and line numbers" >&5
     2429echo "configure:2430: checking whether to track files and line numbers" >&5
    24222430if test "$with_track_fl" = no && test "$with_track_return" = no; then
    24232431  with_track_fl=yes
     
    24392447
    24402448echo $ac_n "checking whether to track stack backtraces""... $ac_c" 1>&6
    2441 echo "configure:2442: checking whether to track stack backtraces" >&5
     2449echo "configure:2450: checking whether to track stack backtraces" >&5
    24422450if test "$with_track" != no && test "$ac_cv_get_backtrace_works" = yes && test "$with_track_backtrace" != no && test "$ac_cv_prog_addr2line_works" = yes; then
    24432451  with_track_backtrace=yes
     
    24522460
    24532461echo $ac_n "checking whether to track custom values""... $ac_c" 1>&6
    2454 echo "configure:2455: checking whether to track custom values" >&5 
     2462echo "configure:2463: checking whether to track custom values" >&5 
    24552463if test "$with_track" != no && test "$with_track_custom" = yes; then
    24562464  cat >> confdefs.h <<\EOF
  • omalloc/configure.in

    r4e6908 rd83977  
    44dnl Author:  obachman@mathematik.uni-kl.de (Olaf Bachmann)
    55dnl Created: 11/99
    6 dnl Version: $Id: configure.in,v 1.11 2000-12-21 14:26:06 obachman Exp $
     6dnl Version: $Id: configure.in,v 1.12 2001-01-27 17:03:39 obachman Exp $
    77dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
    88
     
    239239if test "${with_malloc}" = system; then
    240240  OM_MALLOC_HEADER=omMallocSystem.h
     241  AC_DEFINE(OMALLOC_USES_MALLOC)
    241242  if test "${with_provide_malloc}" = yes || test "${with_provide_malloc}" = debug; then
    242243    AC_MSG_ERROR("can not provide malloc for --with-malloc=system")
     
    257258  OM_MALLOC_HEADER=$with_external_malloc_h
    258259  OM_MALLOC_SOURCE=$with_external_malloc_c
     260  AC_DEFINE(OMALLOC_USES_MALLOC)
    259261else
    260262  with_malloc=dlmalloc
     
    353355fi
    354356if test "${with_valloc}" = malloc; then
    355   if test "{ac_cv_working_valloc}" != no; then
     357  if test "${ac_cv_working_valloc}" != no; then
    356358    AC_DEFINE(OM_HAVE_VALLOC_MALLOC)
    357359  else
  • omalloc/omConfig.h.in

    r4e6908 rd83977  
    55 *  Author:  obachman (Olaf Bachmann)
    66 *  Created: 11/99
    7  *  Version: $Id: omConfig.h.in,v 1.6 2000-09-12 16:02:18 obachman Exp $
     7 *  Version: $Id: omConfig.h.in,v 1.7 2001-01-27 17:03:40 obachman Exp $
    88 *******************************************************************/
    99#ifndef OM_CONFIG_H
     
    177177#endif
    178178#endif /* OM_CONFIG_H  */
     179/* define if omalloc depends on "external" malloc functions like
     180   those provided by the system -- if this id defined, an application
     181   linking with omalloc needs to assure that a library containing malloc
     182   is linked, as well */
     183#ifndef OMALLOC_USES_MALLOC
     184#define OMALLOC_USES_MALLOC
     185#endif
  • omalloc/omFindExec.c

    r4e6908 rd83977  
    44 *  Author:  obachman (Olaf Bachmann)
    55 *  Created: 11/99
    6  *  Version: $Id: omFindExec.c,v 1.7 2000-12-12 16:25:43 levandov Exp $
     6 *  Version: $Id: omFindExec.c,v 1.8 2001-01-27 17:03:40 obachman Exp $
    77 *******************************************************************/
    88
     
    219219}
    220220 
    221  
    222 char * omFindExec (const char *name, char* exec)
     221#ifdef WINNT
     222char * _omFindExec (const char *name, char* exec);
     223/* for windows, serch first for .exe */
     224char* omFindExec(const char *name, char* exec)
     225{
     226 
     227  if (strstr(name, ".exe") == NULL)
     228  {
     229    char buf[MAXPATHLEN];
     230    char* ret;
     231    strcpy(buf, name);
     232    strcat(buf, ".exe");
     233    ret = _omFindExec(buf, exec);
     234    if (ret != NULL) return ret;
     235  }
     236  return _omFindExec(name, exec);
     237}
     238#else
     239#define _omFindExec omFindExec
     240#endif
     241
     242char * _omFindExec (const char *name, char* exec)
    223243{
    224244  char * link = omFindExec_link(name, exec);
  • omalloc/omMmap.c

    r4e6908 rd83977  
    44 *  Author:  obachman (Olaf Bachmann)
    55 *  Created: 11/99
    6  *  Version: $Id: omMmap.c,v 1.4 2001-01-24 16:44:10 levandov Exp $
     6 *  Version: $Id: omMmap.c,v 1.5 2001-01-27 17:03:40 obachman Exp $
    77 *******************************************************************/
    88#include <unistd.h>
     
    2121#endif
    2222
    23 #ifdef ix86_Win
     23#ifdef MAP_ANONYMOUS
     24#ifndef __CYGWIN__
     25  /* under cygwin, MAP_PRIVATE|MAP_ANONYMOUS fails */
     26  addr = mmap(0, size, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);
     27#else
     28  /* however, the following works */
    2429  addr = mmap(0, size, PROT_READ|PROT_WRITE, MAP_PRIVATE, -1, 0);
    25 #elif defined(MAP_ANONYMOUS)
    26   addr = mmap(0, size, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);
     30#endif
    2731#else /* !MAP_ANONYMOUS */
    2832  if (fd < 0)
  • omalloc/omRet2Info.c

    r4e6908 rd83977  
    44 *  Author:  obachman (Olaf Bachmann)
    55 *  Created: 11/99
    6  *  Version: $Id: omRet2Info.c,v 1.12 2000-12-14 17:24:31 obachman Exp $
     6 *  Version: $Id: omRet2Info.c,v 1.13 2001-01-27 17:03:41 obachman Exp $
    77 *******************************************************************/
    88#include <stdio.h>
     
    7676      i++;
    7777    }
    78     fflush(stdin);
     78    fflush(NULL);
    7979    pipe = popen(command, "r");
    8080    if (pipe != NULL)
  • omalloc/om_Alloc.h

    r4e6908 rd83977  
    44 *  Author:  obachman@mathematik.uni-kl.de (Olaf Bachmann)
    55 *  Created: 11/99
    6  *  Version: $Id: om_Alloc.h,v 1.1 2000-12-12 15:26:18 obachman Exp $
     6 *  Version: $Id: om_Alloc.h,v 1.2 2001-01-27 17:03:41 obachman Exp $
    77 *******************************************************************/
    88#ifndef OM_ALLOC_H
     
    3636#include "omDebug.h"
    3737#include "omInline.h"
     38#include "omAllocFunc.h"
    3839
    3940#ifdef __cplusplus
  • omalloc/omalloc.c

    r4e6908 rd83977  
    55 *  Author:  obachman@mathematik.uni-kl.de (Olaf Bachmann)
    66 *  Created: 11/99
    7  *  Version: $Id: omalloc.c,v 1.5 2000-12-21 16:23:59 obachman Exp $
     7 *  Version: $Id: omalloc.c,v 1.6 2001-01-27 17:03:41 obachman Exp $
    88 *******************************************************************/
    99
     
    8383}
    8484
    85 /* on some systems strdup is a macro -- replace it */
     85/* on some systems strdup is a macro -- replace it unless OMALLOC_FUNC
     86   is defined */
     87#if !defined(OMALOC_FUNC)
    8688#undef strdup
     89#endif
    8790char* strdup(const char* addr)
    8891{
     
    9699  return NULL;
    97100}
    98 
    99101void freeSize(void* addr, size_t size)
    100102{
     
    117119  }
    118120}
     121
    119122#endif
  • omalloc/omalloc_provide.c

    r4e6908 rd83977  
    11/*******************************************************************
    22 *  File:    omalloc_provide.c
    3  *  Purpose: implementation of ANSI-C conforming which are to be provided
    4  *           by omalloc library
     3 *  Purpose: implementation of ANSI-C conforming malloc functions
     4 *            which are to be provided by omalloc library
    55 *  Author:  obachman@mathematik.uni-kl.de (Olaf Bachmann)
    66 *  Created: 11/99
    7  *  Version: $Id: omalloc_provide.c,v 1.3 2000-08-14 12:26:51 obachman Exp $
     7 *  Version: $Id: omalloc_provide.c,v 1.4 2001-01-27 17:03:41 obachman Exp $
    88 *******************************************************************/
    99#include "omConfig.h"
Note: See TracChangeset for help on using the changeset viewer.