Ejemplo n.º 1
0
extern "C" void *mremap(void *old_address, size_t old_size,
                        size_t new_size, int flags, ...)
{
  va_list ap;
  va_start( ap, flags );
  void *new_address = va_arg ( ap, void * );
  va_end ( ap );

  MALLOC_FAMILY_WRAPPER_HEADER(mremap, old_address, old_size, new_size, flags,
                               new_address);
  if (SYNC_IS_REPLAY) {
    MALLOC_FAMILY_WRAPPER_REPLAY_START(mremap);
    void *addr = GET_COMMON(my_entry, retval);
    flags |= (MREMAP_MAYMOVE | MREMAP_FIXED);
    retval = _real_mremap (old_address, old_size, new_size, flags, addr);
    JASSERT ( retval == GET_COMMON(my_entry, retval) );
    MALLOC_FAMILY_WRAPPER_REPLAY_END(mremap);
  } else if (SYNC_IS_RECORD) {
    _real_pthread_mutex_lock(&mmap_lock);
    retval = _real_mremap (old_address, old_size, new_size, flags, new_address);
    WRAPPER_LOG_WRITE_ENTRY(my_entry);
    _real_pthread_mutex_unlock(&mmap_lock);
  }
  return retval;
}
Ejemplo n.º 2
0
extern "C" void *mremap(void *old_address, size_t old_size,
    size_t new_size, int flags)
{

  MALLOC_FAMILY_WRAPPER_HEADER(mremap, old_address, old_size, new_size, flags,
			       NULL);
  if (SYNC_IS_REPLAY) {
    MALLOC_FAMILY_WRAPPER_REPLAY_START(mremap);
    void *addr = GET_COMMON(my_entry, retval);
    flags |= MREMAP_MAYMOVE;
    retval = _real_mremap (old_address, old_size, new_size, flags, addr);
    JASSERT ( retval == GET_COMMON(my_entry, retval) );
    MALLOC_FAMILY_WRAPPER_REPLAY_END(mremap);
  } else if (SYNC_IS_RECORD) {
    _real_pthread_mutex_lock(&mmap_lock);
    retval = _real_mremap (old_address, old_size, new_size, flags, 0);
    WRAPPER_LOG_WRITE_ENTRY(my_entry);
    _real_pthread_mutex_unlock(&mmap_lock);
  }
  return retval;
}
Ejemplo n.º 3
0
extern "C" void *mremap(void *old_address, size_t old_size,
                        size_t new_size, int flags, ...)
{
  void *retval;

  DMTCP_PLUGIN_DISABLE_CKPT();
  if (flags == MREMAP_FIXED) {
    va_list ap;
    va_start(ap, flags);
    void *new_address = va_arg(ap, void *);
    va_end(ap);
    retval = _real_mremap(old_address, old_size, new_size, flags, new_address);
  } else {