Commit cff3894c authored by legoyb's avatar legoyb
Browse files

Adapted Type Pointer

parent e4fe44fa
......@@ -20,17 +20,15 @@ void *mark_memarea_and_get_user_ptr(void *ptr, unsigned long size, MemKind k)
unsigned long magic_value = knuth_mmix_one_round(* (unsigned long *) ptr) & ~(0b11UL) & (unsigned long) k;
unsigned long real_size = size + 32;
unsigned long *pointer = (unsigned long *) ptr;
// Set First 16 bytes
*pointer = real_size;
*(pointer + 8) = magic_value;
* (unsigned long *) ptr = real_size;
* (unsigned long *) (ptr + 8) = magic_value;
// TODO: set to 0 ?
// Set Last 16 bytes
*(pointer + size + 16) = magic_value;
*(pointer + size + 24) = real_size;
* (unsigned long *) (ptr + size + 16) = magic_value;
* (unsigned long *) (ptr + size + 24) = real_size;
return ptr + 16;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment