Rev 1286 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1286 | Rev 1624 | ||
---|---|---|---|
Line 35... | Line 35... | ||
35 | * @return pointer to tcb_t structure |
35 | * @return pointer to tcb_t structure |
36 | * |
36 | * |
37 | */ |
37 | */ |
38 | tcb_t * __alloc_tls(void **data, size_t size) |
38 | tcb_t * __alloc_tls(void **data, size_t size) |
39 | { |
39 | { |
40 | tcb_t *tcb; |
40 | tcb_t *result; |
41 | 41 | ||
42 | *data = malloc(sizeof(tcb_t) + size); |
42 | result = malloc(sizeof(tcb_t) + size); |
43 | tcb = (tcb_t *) (*data + size); |
43 | *data = ((void *)result) + sizeof(tcb_t); |
44 | return tcb; |
44 | return result; |
45 | } |
45 | } |
46 | 46 | ||
47 | void __free_tls_arch(tcb_t *tcb, size_t size) |
47 | void __free_tls_arch(tcb_t *tcb, size_t size) |
48 | { |
48 | { |
49 | void *start = ((void *) tcb) - size; |
- | |
50 | free(start); |
49 | free(tcb); |
51 | } |
50 | } |