~ubuntu-branches/ubuntu/vivid/gcl/vivid

« back to all changes in this revision

Viewing changes to o/gmp.c

  • Committer: Bazaar Package Importer
  • Author(s): Camm Maguire
  • Date: 2002-03-04 14:29:59 UTC
  • Revision ID: james.westby@ubuntu.com-20020304142959-dey14w08kr7lldu3
Tags: upstream-2.5.0.cvs20020219
ImportĀ upstreamĀ versionĀ 2.5.0.cvs20020219

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
 
 
3
#define ALLOCATE(n) (*gcl_gmp_allocfun)(n)
 
4
 
 
5
void *gcl_gmp_alloc(size_t size)
 
6
{
 
7
   return (void *) ALLOCATE(size);
 
8
}
 
9
 
 
10
void *gcl_gmp_realloc(void *oldmem, size_t oldsize, size_t newsize)
 
11
{
 
12
  unsigned int *old,*new;
 
13
  int i = oldsize;
 
14
  if (MP_SELF(big_gcprotect)) abort();
 
15
  MP_SELF(big_gcprotect)=oldmem;
 
16
  MP_ALLOCATED(big_gcprotect)=oldsize/MP_LIMB_SIZE;
 
17
  new = (void *)ALLOCATE(newsize);
 
18
  old = oldmem;
 
19
  bcopy(MP_SELF(big_gcprotect),new,oldsize);
 
20
  MP_SELF(big_gcprotect)=0;
 
21
  if (inheap(oldmem)) insert_contblock(oldmem,oldsize);
 
22
  return new;
 
23
}
 
24
 
 
25
void gcl_gmp_free(void *old, size_t oldsize)
 
26
{
 
27
}
 
28