Changeset 898

Show
Ignore:
Timestamp:
05/13/08 14:52:05 (4 months ago)
Author:
Gregor
Message:

rebuild/Makefile, rebuild/mars.c, rebuild/mem.c: No longer uses libgc :(

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/rebuild/Makefile

    r888 r898  
    44CXXFLAGS=-g 
    55 
    6 GC=-Wl,-Bstatic,-lgc,-Bdynamic 
    76THREADS=-pthread 
    87 
     
    109 
    1110LDFLAGS= 
    12 LIBS=$(GC) $(THREADS) 
     11LIBS=$(THREADS) 
    1312 
    1413PREFIX=/usr 
  • trunk/rebuild/mars.c

    r897 r898  
    2626 
    2727#include <pthread.h> 
    28 #include "gc/gc.h" 
    2928 
    3029#if _WIN32 
  • trunk/rebuild/mem.c

    r888 r898  
    11 
    22/* Copyright (c) 2000 Digital Mars  */ 
    3 /* Copyright (c) 2008 Gregor Richards   */ 
     3/* All Rights Reserved             */ 
    44 
    55#include <stdio.h> 
     
    77#include <string.h> 
    88 
    9 #include "gc/gc.h" 
     9#include "mem.h" 
    1010 
    11 #include "mem.h" 
     11/* This implementation of the storage allocator uses the standard C allocation package. 
     12 */ 
    1213 
    1314Mem mem; 
     
    1516void Mem::init() 
    1617{ 
    17     GC_INIT(); 
    1818} 
    1919 
     
    2424    if (s) 
    2525    { 
    26     p = GC_strdup(s); 
     26    p = ::strdup(s); 
    2727    if (p) 
    2828        return p; 
     
    3939    else 
    4040    { 
    41     p = GC_malloc(size); 
     41    p = ::malloc(size); 
    4242    if (!p) 
    4343        error(); 
     
    5353    else 
    5454    { 
    55     //p = ::calloc(size, n); 
    56         p = GC_malloc(size*n); 
    57         memset(p, 0, size*n); 
     55    p = ::calloc(size, n); 
    5856    if (!p) 
    5957        error(); 
     
    6664    if (!size) 
    6765    {   if (p) 
    68     {   GC_free(p); 
     66    {   ::free(p); 
    6967        p = NULL; 
    7068    } 
     
    7270    else if (!p) 
    7371    { 
    74     p = GC_malloc(size); 
     72    p = ::malloc(size); 
    7573    if (!p) 
    7674        error(); 
     
    7876    else 
    7977    { 
    80     p = GC_realloc(p, size); 
     78    p = ::realloc(p, size); 
    8179    if (!p) 
    8280        error(); 
     
    8886{ 
    8987    if (p) 
    90     GC_free(p); 
     88    ::free(p); 
    9189} 
    9290 
     
    9896    else 
    9997    { 
    100     p = GC_malloc(size); 
     98    p = ::malloc(size); 
    10199    if (!p) 
    102100        error(); 
     
    115113void Mem::fullcollect() 
    116114{ 
    117     GC_gcollect(); 
    118115} 
    119116 
     
    127124void * operator new(size_t m_size) 
    128125{    
    129     void *p = GC_malloc(m_size); 
     126    void *p = malloc(m_size); 
    130127    if (p) 
    131128    return p; 
     
    137134void operator delete(void *p) 
    138135{ 
    139     GC_free(p); 
     136    free(p); 
    140137} 
    141138