version 1.1.1.1, 2012/02/21 23:05:52
|
version 1.1.1.2, 2012/02/21 23:50:25
|
Line 1
|
Line 1
|
/* |
/* |
* Stack-less Just-In-Time compiler |
* Stack-less Just-In-Time compiler |
* |
* |
* Copyright 2009-2010 Zoltan Herczeg (hzmester@freemail.hu). All rights reserved. | * Copyright 2009-2012 Zoltan Herczeg (hzmester@freemail.hu). All rights reserved. |
* |
* |
* Redistribution and use in source and binary forms, with or without modification, are |
* Redistribution and use in source and binary forms, with or without modification, are |
* permitted provided that the following conditions are met: |
* permitted provided that the following conditions are met: |
Line 263 SLJIT_API_FUNC_ATTRIBUTE void sljit_free_exec(void* pt
|
Line 263 SLJIT_API_FUNC_ATTRIBUTE void sljit_free_exec(void* pt
|
header->prev_size = free_block->size; |
header->prev_size = free_block->size; |
} |
} |
|
|
|
/* The whole chunk is free. */ |
if (SLJIT_UNLIKELY(!free_block->header.prev_size && header->size == 1)) { |
if (SLJIT_UNLIKELY(!free_block->header.prev_size && header->size == 1)) { |
|
/* If this block is freed, we still have (allocated_size / 2) free space. */ |
if (total_size - free_block->size > (allocated_size * 3 / 2)) { |
if (total_size - free_block->size > (allocated_size * 3 / 2)) { |
|
total_size -= free_block->size; |
sljit_remove_free_block(free_block); |
sljit_remove_free_block(free_block); |
free_chunk(free_block, free_block->size + sizeof(struct block_header)); |
free_chunk(free_block, free_block->size + sizeof(struct block_header)); |
} |
} |