51 |
* exception also makes it possible to release a modified version which |
* exception also makes it possible to release a modified version which |
52 |
* carries forward this exception. |
* carries forward this exception. |
53 |
* |
* |
54 |
* $Id: mem_align.c,v 1.11 2002-11-17 00:51:11 edgomez Exp $ |
* $Id: mem_align.c,v 1.13 2002-12-15 01:12:01 edgomez Exp $ |
55 |
* |
* |
56 |
****************************************************************************/ |
****************************************************************************/ |
57 |
|
|
88 |
if ((mem_ptr = (uint8_t *) malloc(size + 1)) != NULL) { |
if ((mem_ptr = (uint8_t *) malloc(size + 1)) != NULL) { |
89 |
|
|
90 |
/* Store (mem_ptr - "real allocated memory") in *(mem_ptr-1) */ |
/* Store (mem_ptr - "real allocated memory") in *(mem_ptr-1) */ |
91 |
*mem_ptr = 0; |
*mem_ptr = 1; |
92 |
|
|
93 |
/* Return the mem_ptr pointer */ |
/* Return the mem_ptr pointer */ |
94 |
return (void *) mem_ptr++; |
return (void *)(mem_ptr+1); |
95 |
|
|
96 |
} |
} |
97 |
|
|