コード例 #1
0
ファイル: rtasm_x86sse.c プロジェクト: ChillyWillyGuru/RSXGL
static void do_realloc( struct x86_function *p )
{
   if (p->store == p->error_overflow) {
      p->csr = p->store;
   }
   else if (p->size == 0) {
      p->size = 1024;
      p->store = rtasm_exec_malloc(p->size);
      p->csr = p->store;
   }
   else {
      uintptr_t used = pointer_to_uintptr( p->csr ) - pointer_to_uintptr( p->store );
      unsigned char *tmp = p->store;
      p->size *= 2;
      p->store = rtasm_exec_malloc(p->size);

      if (p->store) {
         memcpy(p->store, tmp, used);
         p->csr = p->store + used;
      }
      else {
         p->csr = p->store;
      }

      rtasm_exec_free(tmp);
   }

   if (p->store == NULL) {
      p->store = p->csr = p->error_overflow;
      p->size = sizeof(p->error_overflow);
   }
}
コード例 #2
0
ファイル: native_dri2.c プロジェクト: CSRedRat/mesa-1
static unsigned
dri2_display_hash_table_hash(void *key)
{
   XID drawable = pointer_to_uintptr(key);
   return (unsigned) drawable;
}