The R Project SVN R

Rev

Rev 40788 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 40788 Rev 40801
Line 2525... Line 2525...
2525
      ABORT;
2525
      ABORT;
2526
  }
2526
  }
2527
  return 0;
2527
  return 0;
2528
}
2528
}
2529
 
2529
 
-
 
2530
#if 0
2530
/* support for mallopt */
2531
/* support for mallopt */
2531
static int change_mparam(int param_number, int value) {
2532
static int change_mparam(int param_number, int value) {
2532
  size_t val = (size_t)value;
2533
  size_t val = (size_t)value;
2533
  init_mparams();
2534
  init_mparams();
2534
  switch(param_number) {
2535
  switch(param_number) {
Line 2547... Line 2548...
2547
    return 1;
2548
    return 1;
2548
  default:
2549
  default:
2549
    return 0;
2550
    return 0;
2550
  }
2551
  }
2551
}
2552
}
-
 
2553
#endif
2552
 
2554
 
2553
#if DEBUG
2555
#if DEBUG
2554
/* ------------------------- Debugging Support --------------------------- */
2556
/* ------------------------- Debugging Support --------------------------- */
2555
 
2557
 
2556
/* Check properties of any chunk, whether free, inuse, mmapped etc  */
2558
/* Check properties of any chunk, whether free, inuse, mmapped etc  */
Line 2858... Line 2860...
2858
  }
2860
  }
2859
  return nm;
2861
  return nm;
2860
}
2862
}
2861
#endif /* !NO_MALLINFO */
2863
#endif /* !NO_MALLINFO */
2862
 
2864
 
-
 
2865
#if 0
2863
static void internal_malloc_stats(mstate m) {
2866
static void internal_malloc_stats(mstate m) {
2864
  if (!PREACTION(m)) {
2867
  if (!PREACTION(m)) {
2865
    size_t maxfp = 0;
2868
    size_t maxfp = 0;
2866
    size_t fp = 0;
2869
    size_t fp = 0;
2867
    size_t used = 0;
2870
    size_t used = 0;
Line 2889... Line 2892...
2889
    fprintf(stderr, "in use bytes     = %10lu\n", (unsigned long)(used));
2892
    fprintf(stderr, "in use bytes     = %10lu\n", (unsigned long)(used));
2890
 
2893
 
2891
    POSTACTION(m);
2894
    POSTACTION(m);
2892
  }
2895
  }
2893
}
2896
}
-
 
2897
#endif
2894
 
2898
 
2895
/* ----------------------- Operations on smallbins ----------------------- */
2899
/* ----------------------- Operations on smallbins ----------------------- */
2896
 
2900
 
2897
/*
2901
/*
2898
  Various forms of linking and unlinking are defined as macros.  Even
2902
  Various forms of linking and unlinking are defined as macros.  Even
Line 3841... Line 3845...
3841
  return 0;
3845
  return 0;
3842
}
3846
}
3843
 
3847
 
3844
/* --------------------------- memalign support -------------------------- */
3848
/* --------------------------- memalign support -------------------------- */
3845
 
3849
 
-
 
3850
#if 0
3846
static void* internal_memalign(mstate m, size_t alignment, size_t bytes) {
3851
static void* internal_memalign(mstate m, size_t alignment, size_t bytes) {
3847
  if (alignment <= MALLOC_ALIGNMENT)    /* Can just use malloc */
3852
  if (alignment <= MALLOC_ALIGNMENT)    /* Can just use malloc */
3848
    return internal_malloc(m, bytes);
3853
    return internal_malloc(m, bytes);
3849
  if (alignment <  MIN_CHUNK_SIZE) /* must be at least a minimum chunk size */
3854
  if (alignment <  MIN_CHUNK_SIZE) /* must be at least a minimum chunk size */
3850
    alignment = MIN_CHUNK_SIZE;
3855
    alignment = MIN_CHUNK_SIZE;
Line 4053... Line 4058...
4053
#endif /* DEBUG */
4058
#endif /* DEBUG */
4054
 
4059
 
4055
  POSTACTION(m);
4060
  POSTACTION(m);
4056
  return marray;
4061
  return marray;
4057
}
4062
}
4058
 
4063
#endif
4059
 
4064
 
4060
/* -------------------------- public routines ---------------------------- */
4065
/* -------------------------- public routines ---------------------------- */
4061
 
4066
 
4062
#if !ONLY_MSPACES
4067
#if !ONLY_MSPACES
4063
 
4068
 
Line 4329... Line 4334...
4329
#endif /* FOOTERS */
4334
#endif /* FOOTERS */
4330
    return internal_realloc(m, oldmem, bytes);
4335
    return internal_realloc(m, oldmem, bytes);
4331
  }
4336
  }
4332
}
4337
}
4333
 
4338
 
-
 
4339
#if 0
4334
void* dlmemalign(size_t alignment, size_t bytes) {
4340
void* dlmemalign(size_t alignment, size_t bytes) {
4335
  return internal_memalign(gm, alignment, bytes);
4341
  return internal_memalign(gm, alignment, bytes);
4336
}
4342
}
4337
 
4343
 
4338
void** dlindependent_calloc(size_t n_elements, size_t elem_size,
4344
void** dlindependent_calloc(size_t n_elements, size_t elem_size,
Line 4374... Line 4380...
4374
}
4380
}
4375
 
4381
 
4376
size_t dlmalloc_max_footprint(void) {
4382
size_t dlmalloc_max_footprint(void) {
4377
  return gm->max_footprint;
4383
  return gm->max_footprint;
4378
}
4384
}
-
 
4385
#endif
4379
 
4386
 
4380
#if !NO_MALLINFO
4387
#if !NO_MALLINFO
4381
struct mallinfo dlmallinfo(void) {
4388
struct mallinfo dlmallinfo(void) {
4382
  return internal_mallinfo(gm);
4389
  return internal_mallinfo(gm);
4383
}
4390
}
4384
#endif /* NO_MALLINFO */
4391
#endif /* NO_MALLINFO */
4385
 
4392
 
-
 
4393
#if 0
4386
void dlmalloc_stats() {
4394
void dlmalloc_stats() {
4387
  internal_malloc_stats(gm);
4395
  internal_malloc_stats(gm);
4388
}
4396
}
4389
 
4397
 
4390
size_t dlmalloc_usable_size(void* mem) {
4398
size_t dlmalloc_usable_size(void* mem) {
Line 4397... Line 4405...
4397
}
4405
}
4398
 
4406
 
4399
int dlmallopt(int param_number, int value) {
4407
int dlmallopt(int param_number, int value) {
4400
  return change_mparam(param_number, value);
4408
  return change_mparam(param_number, value);
4401
}
4409
}
-
 
4410
#endif
4402
 
4411
 
4403
#endif /* !ONLY_MSPACES */
4412
#endif /* !ONLY_MSPACES */
4404
 
4413
 
4405
/* ----------------------------- user mspaces ---------------------------- */
4414
/* ----------------------------- user mspaces ---------------------------- */
4406
 
4415